PopUpCoachMarkPresenter { protected void setTypeFaceForDismissButton(@Nullable String fontFileForDismissButton) { if (StringUtils.isNull(fontFileForDismissButton)) { return; } Typeface typeface = mTypeFaceProvider.getTypeFaceFromAssets(fontFileForDismissButton); if (typeface != null) { mPresentation.setTypeFaceForDismissButton(typeface); } } PopUpCoachMarkPresenter(final IStringResourceProvider stringResourceProvider,
                                   final IDimensionResourceProvider dimensionResourceProvider,
                                   final ITypeFaceProvider typeFaceProvider,
                                   final IScreenInfoProvider screenInfoProvider); void onCreate(CoachMarkBuilder coachMarkBuilder); void onCreateView(IPopUpCoachMarkPresentation popUpCoachMarkPresentation); void onViewCreated(); void onDestroyView(); void onDestroy(); void onOkButtonClicked(); void onShimClicked();  }
@Test public void setTypeFaceForDismissButtonNullFontFileTest() { mPopUpCoachMarkPresenter.setTypeFaceForDismissButton(null); Mockito.verify(mTypeFaceProvider, Mockito.times(0)).getTypeFaceFromAssets(Matchers.anyString()); Mockito.verify(mPopUpCoachMarkPresentation, Mockito.times(0)) .setTypeFaceForDismissButton((Typeface) Matchers.anyObject()); }
@Test public void setTypeFaceForDismissButtonNullTypeFaceTest() { Mockito.when(mTypeFaceProvider.getTypeFaceFromAssets(Matchers.anyString())).thenReturn(null); mPopUpCoachMarkPresenter.setTypeFaceForDismissButton(Matchers.anyString()); Mockito.verify(mTypeFaceProvider, Mockito.times(1)).getTypeFaceFromAssets(Matchers.anyString()); Mockito.verify(mPopUpCoachMarkPresentation, Mockito.times(0)) .setTypeFaceForDismissButton((Typeface) Matchers.anyObject()); Mockito.verifyNoMoreInteractions(mPopUpCoachMarkPresentation); }
@Test public void setTypeFaceForDismissButtonTest() { Typeface typeface = Mockito.mock(Typeface.class); Mockito.when(mTypeFaceProvider.getTypeFaceFromAssets(Matchers.anyString())).thenReturn(typeface); mPopUpCoachMarkPresenter.setTypeFaceForDismissButton("fontFilePath"); Mockito.verify(mTypeFaceProvider, Mockito.times(1)).getTypeFaceFromAssets(Matchers.anyString()); Mockito.verify(mPopUpCoachMarkPresentation, Mockito.times(1)) .setTypeFaceForDismissButton(typeface); Mockito.verifyNoMoreInteractions(mPopUpCoachMarkPresentation); }