@Test public void shouldShowPasswordEmptyMessageAfterMethodInvoked() { loginActivity.showPasswordEmpty(); String emptyErrorMessage = loginActivity.getResources().getString(R.string.msg_empty_user); TextView usernameErrorView = RobolectricUtils.getErrorTextView(loginActivity.lyUserName); TextView passwordErrorView = RobolectricUtils.getErrorTextView(loginActivity.lyPassword); assertThat(usernameErrorView).isNull(); assertThat(passwordErrorView).isNotNull(); assertThat(passwordErrorView.getText().toString()).isEqualTo(emptyErrorMessage); }
@Override public void showPasswordEmpty() { clearErrorAlerts(); lyPassword.setError(getResources().getString(R.string.msg_empty_user)); etPassword.getBackground().setColorFilter(getResources().getColor(R.color.color_red), PorterDuff.Mode.SRC_ATOP); }
LoginActivity extends BaseActivity implements LoginPresenter.LoginView, View.OnClickListener { @Override public void showPasswordEmpty() { clearErrorAlerts(); lyPassword.setError(getResources().getString(R.string.msg_empty_user)); etPassword.getBackground().setColorFilter(getResources().getColor(R.color.color_red), PorterDuff.Mode.SRC_ATOP); } }
LoginActivity extends BaseActivity implements LoginPresenter.LoginView, View.OnClickListener { @Override public void showPasswordEmpty() { clearErrorAlerts(); lyPassword.setError(getResources().getString(R.string.msg_empty_user)); etPassword.getBackground().setColorFilter(getResources().getColor(R.color.color_red), PorterDuff.Mode.SRC_ATOP); }  }
LoginActivity extends BaseActivity implements LoginPresenter.LoginView, View.OnClickListener { @Override public void showPasswordEmpty() { clearErrorAlerts(); lyPassword.setError(getResources().getString(R.string.msg_empty_user)); etPassword.getBackground().setColorFilter(getResources().getColor(R.color.color_red), PorterDuff.Mode.SRC_ATOP); }  @Override void sendScreenToGoogleAnalyticsAfterLogin(); void goToInitInventory(); void goToHomePage(); void launchActivity(Intent intent); void clearPassword(); void clearErrorAlerts(); @Override boolean needInitInventory(); @Override void showInvalidAlert(); @Override void showPasswordEmpty(); @Override void showUserNameEmpty(); @Override void onClick(View v); @Override void loaded(); @Override void onBackPressed(); void sendSyncStartBroadcast(); void sendSyncFinishedBroadcast(); @Override void sendSyncErrorBroadcast(); }
LoginActivity extends BaseActivity implements LoginPresenter.LoginView, View.OnClickListener { @Override public void showPasswordEmpty() { clearErrorAlerts(); lyPassword.setError(getResources().getString(R.string.msg_empty_user)); etPassword.getBackground().setColorFilter(getResources().getColor(R.color.color_red), PorterDuff.Mode.SRC_ATOP); }  @Override void sendScreenToGoogleAnalyticsAfterLogin(); void goToInitInventory(); void goToHomePage(); void launchActivity(Intent intent); void clearPassword(); void clearErrorAlerts(); @Override boolean needInitInventory(); @Override void showInvalidAlert(); @Override void showPasswordEmpty(); @Override void showUserNameEmpty(); @Override void onClick(View v); @Override void loaded(); @Override void onBackPressed(); void sendSyncStartBroadcast(); void sendSyncFinishedBroadcast(); @Override void sendSyncErrorBroadcast(); @InjectView(R.id.tx_username)
    public EditText etUsername; @InjectView(R.id.tx_password)
    public EditText etPassword; @InjectView(R.id.btn_login)
    public Button btnLogin; @InjectView(R.id.ly_username)
    public TextInputLayout lyUserName; @InjectView(R.id.ly_password)
    public TextInputLayout lyPassword; @InjectView(R.id.iv_visibility_pwd)
    public ImageView ivVisibilityPwd; @InjectView(R.id.iv_logo)
    public ImageView ivLogo; @InjectView(R.id.tv_version)
    public TextView tvVersion; }