AuthPresenter implements AuthContract.Presenter { @Override public void handleFirebaseSignInResult(boolean signedIn) { mView.setProgressIndicator(false); if (signedIn) { mView.closeAuthUi(); mView.updateWidget(); } else { mView.showSignInButton(true); mView.showFailMessage(); } } @Inject  AuthPresenter(AuthContract.View view); @Override void googleSignIn(); @Override void handleGoogleSignInResult(boolean signedIn); @Override void handleFirebaseSignInResult(boolean signedIn);  }
@Test public void firebaseAuthSignInFails_ShowsSignInButton() { mAuthPresenter.handleFirebaseSignInResult(false); verify(mView).showSignInButton(true); }
@Test public void firebaseAuthSignInFails_HidesProgressBar() { mAuthPresenter.handleFirebaseSignInResult(false); verify(mView).setProgressIndicator(false); }
@Test public void firebaseAuthSignInSucceeds_HidesProgressBar() { mAuthPresenter.handleFirebaseSignInResult(true); verify(mView).setProgressIndicator(false); }
@Test public void firebaseAuthSignInSucceeds_ShowsItemsUi() { mAuthPresenter.handleFirebaseSignInResult(true); verify(mView).closeAuthUi(); }
@Test public void firebaseAuthSucceeds_SetsUserId() { mAuthPresenter.handleFirebaseSignInResult(true); }
@Test public void firebaseAuthSignInFails_ShowsFailMsg() { mAuthPresenter.handleFirebaseSignInResult(false); verify(mView).showFailMessage(); }