ErrorEditText extends TextInputEditText { public void setFieldHint(int hint) { setFieldHint(getContext().getString(hint)); } ErrorEditText(Context context);  ErrorEditText(Context context, AttributeSet attrs);  ErrorEditText(Context context, AttributeSet attrs, int defStyle); @Override void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter); void setFieldHint(int hint); void setFieldHint(String hint); @SuppressWarnings("WrongConstant") View focusNextView(); void setOptional(boolean optional); boolean isOptional(); boolean isError(); void setError(@Nullable String errorMessage); boolean isValid(); String getErrorMessage(); void validate(); void closeSoftKeyboard(); @Nullable TextInputLayout getTextInputLayoutParent();  }
@Test public void setFieldHint_setsHintWhenParentViewIsATextInputLayout() { mView = (CardEditText) Robolectric.setupActivity(TestActivity.class) .findViewById(R.id.bt_card_form_card_number); mView.setFieldHint(R.string.bt_form_hint_cvv); assertEquals("CVV", ((TextInputLayout) mView.getParent().getParent()).getHint()); assertEquals("CVV", mView.getHint()); }
@Test public void setFieldHint_setsHintStringWhenParentViewIsATextInputLayout() { mView = (CardEditText) Robolectric.setupActivity(TestActivity.class) .findViewById(R.id.bt_card_form_card_number); mView.setFieldHint("CVV"); assertEquals("CVV", ((TextInputLayout) mView.getParent().getParent()).getHint()); assertEquals("CVV", mView.getHint()); }
@Test public void setFieldHint_setsHint() { mView.setFieldHint(R.string.bt_form_hint_cvv); assertEquals(mView.getHint(), "CVV"); }
@Test public void setFieldHint_setsHintString() { mView.setFieldHint("CVV"); assertEquals(mView.getHint(), "CVV"); }