AuthenticatorActivity extends AccountAuthenticatorFragmentActivity implements Injectable { @VisibleForTesting boolean areAllInputsNotEmpty() { return !TextUtils.isEmpty(mTxtUsername.getText()) && !TextUtils.isEmpty(mTxtPassword.getText()); }  @OnClick(R.id.auth_btn_login) void login(); @OnClick(R.id.auth_btn_forgot_password) void forgotPassword(); @Override void onBackPressed();  }
@Test public void areInputsNotEmpty_empty_returnsEmpty() { authenticator.mTxtUsername.setText(""); authenticator.mTxtPassword.setText(""); assertThat(authenticator.areAllInputsNotEmpty()).isFalse(); }
@Test public void areInputsNotEmpty_notEmpty_returnsNotEmpty() { authenticator.mTxtUsername.setText("username"); authenticator.mTxtPassword.setText("password"); assertThat(authenticator.areAllInputsNotEmpty()).isTrue(); }
@Test public void areInputsNotEmpty_null_returnsEmpty() { authenticator.mTxtUsername.setText(null); authenticator.mTxtPassword.setText(null); assertThat(authenticator.areAllInputsNotEmpty()).isFalse(); }
@Test public void areInputsNotEmpty_oneEmpty_returnsEmpty() { authenticator.mTxtUsername.setText("username"); authenticator.mTxtPassword.setText(""); assertThat(authenticator.areAllInputsNotEmpty()).isFalse(); }