@Test public void fetchBooks_LoadsAll_AndShowsThemInUI() { presenter.fetchBooks(); verify(mainView).showBooks(DUMMY_BOOKS); }
public void fetchBooks() { List<Book> books = bookGenerator.generate(45); library.addBooks(books); mainView.showBooks(library.getAllBooks()); }
MainPresenter { public void fetchBooks() { List<Book> books = bookGenerator.generate(45); library.addBooks(books); mainView.showBooks(library.getAllBooks()); } }
MainPresenter { public void fetchBooks() { List<Book> books = bookGenerator.generate(45); library.addBooks(books); mainView.showBooks(library.getAllBooks()); } MainPresenter(MainView mainView, Library library, RandomBookGenerator bookGenerator); }
MainPresenter { public void fetchBooks() { List<Book> books = bookGenerator.generate(45); library.addBooks(books); mainView.showBooks(library.getAllBooks()); } MainPresenter(MainView mainView, Library library, RandomBookGenerator bookGenerator); void searchForBooks(String searchQuery); void fetchBooks(); }
MainPresenter { public void fetchBooks() { List<Book> books = bookGenerator.generate(45); library.addBooks(books); mainView.showBooks(library.getAllBooks()); } MainPresenter(MainView mainView, Library library, RandomBookGenerator bookGenerator); void searchForBooks(String searchQuery); void fetchBooks();  }