### Question:
TranslationPresenter { void setFavoriteStatus() { if (model != null) { translationView.showFavorite(model.isFavourite()); } } TranslationPresenter(SozlikDao sozlikDao);   }### Answer:
@Test public void whenWordIsFavoritedReturnSetFavoriteStatusAsTrue() { when(sozlikDbModelMock.isFavourite()).thenReturn(true); translationPresenter.setFavoriteStatus(); verify(translationViewMock, times(1)).showFavorite(true); verifyNoMoreInteractions(translationViewMock); }
@Test public void whenWordIsNotFavoritedReturnSetFavoriteStatusAsFalse() { when(sozlikDbModelMock.isFavourite()).thenReturn(false); translationPresenter.setFavoriteStatus(); verify(translationViewMock, times(1)).showFavorite(false); verifyNoMoreInteractions(translationViewMock); }