MyDecksPresenter { public void refreshListFooter() { if (decks.isEmpty()) { view.emptyViewState(); view.updateMyDeckListCentered(IS_CENTERED); } else { view.nonEmptyViewState(); view.updateMyDeckListCentered(IS_NOT_CENTERED); } } MyDecksPresenter(MyDecksView view, DeckRepository deckRepository); void refreshListFooter(); void refreshMyDecksList(); List<Deck> getDecks(); void deleteDeck(Deck deck);  }
@Test public void shouldShowEmptyMyDecksViewWhenNoDecksArePresent() { MyDecksPresenter myDecksPresenter = new MyDecksPresenter(view, deckRepository); myDecksPresenter.refreshListFooter(); verify(view).emptyViewState(); verify(view).updateMyDeckListCentered(IS_CENTERED); }
@Test public void shouldShowMyDecksViewWhenDecksArePresent() { ArrayList<Deck> decks = listWithOneDeck(); when(deckRepository.getAllDecks()).thenReturn(decks); MyDecksPresenter myDecksPresenter = new MyDecksPresenter(view, deckRepository); myDecksPresenter.refreshListFooter(); verify(view).nonEmptyViewState(); verify(view).updateMyDeckListCentered(IS_NOT_CENTERED); }