@UiThreadTest public void testDisable() { singleMessageTest(R.string.connection_failed, true); statusViewer.disable(); statusViewer.setMessage(R.string.cancel, false); checkSingleMessage(R.string.connection_failed, View.GONE, View.GONE); }
@UiThreadTest public void testEnable() { testDisable(); statusViewer.enable(); checkSingleMessage(R.string.empty, View.VISIBLE, View.INVISIBLE); singleMessageTest(R.string.app_name, false); }
@Override protected void setUp() { progressBar = new ProgressBar(getActivity()); message = new TextView(getActivity()); statusViewer = new StatusViewer(getActivity()); statusViewer.updateViews(progressBar, message); }
private void singleMessageTest(int messageResource, boolean visibility) { statusViewer.setMessage(messageResource, visibility); int progressBarVisibility; if (visibility) { progressBarVisibility = View.VISIBLE; } else { progressBarVisibility = View.INVISIBLE; } checkSingleMessage(messageResource, View.VISIBLE, progressBarVisibility); }