MainActivityPresenter implements DialogInterface.OnClickListener { public void checkAccessibilityEnabled() { if (!accessibilityChecker.isAccessibilityEnabled(context)) { mainActivityView.showAccessibilityDialog(); } } @Inject  MainActivityPresenter(Set<String> activatedPackages, SharedPreferences sharedPreferences,
      Context context, AccessibilityChecker accessibilityChecker); void setView(MainActivityView mainActivityView); void checkAccessibilityEnabled(); void onAppLockActivateClick(); void onTimingClick(String timing); void onWarningTextClick(); void onCreditTextClick(); void onGithubClick(); @Override void onClick(DialogInterface dialog, int which);  }
@Test public void testSetView_AccessibilityDisabled() throws Exception { given(accessibilityChecker.isAccessibilityEnabled(context)).willReturn(false); mainActivityPresenter.checkAccessibilityEnabled(); verify(mainActivityView).showAccessibilityDialog(); }
@Test public void testSetView_AccessibilityEnabled() throws Exception { given(accessibilityChecker.isAccessibilityEnabled(context)).willReturn(true); mainActivityPresenter.checkAccessibilityEnabled(); verify(mainActivityView, times(0)).showAccessibilityDialog(); }