ToastBuilder { public ToastBuilder message(CharSequence message) { this.message = message; return this; } ToastBuilder(Context context); ToastBuilder customView(View customView); ToastBuilder customViewMessageViewId(int customViewMessageViewId); ToastBuilder message(CharSequence message); ToastBuilder message(@StringRes int messageResId); ToastBuilder messageTextColor(@ColorInt int messageTextColor); ToastBuilder messageTextColorRes(@ColorRes int messageTextColorResId); ToastBuilder duration(int duration); ToastBuilder gravity(int gravity); ToastBuilder gravityOffsetX(int gravityOffsetX); ToastBuilder gravityOffsetY(int gravityOffsetY); @SuppressLint("ShowToast") Toast build();  }
@Test public void whenMessageWithString_thenMessageSet() { createBuilder(); builderUnderTest.message("message"); assertThat(builderUnderTest.message).isEqualTo("message"); }
@Test public void whenMessageWithStringResource_thenMessageSet() { createBuilder(); @StringRes int stringResId = getStringResourceId("Test"); builderUnderTest.message(stringResId); assertThat(builderUnderTest.message).isEqualTo("Test"); }