@Test public void onLoadFlashcardsWouldStartLoadingFlashcards() { when(module.getFlashcards()).thenReturn(Call.empty()); presenter.onLoadFlashcards(); verify(module).getFlashcards(); }
public void onLoadFlashcards() { applyState(IFlashcardsView::showProgress); results.clear(); call = module.getFlashcards(); call.enqueue(data -> { if (data.getWords().size() != 0) { testData = data; applyState(view -> view.showWords(data.getWords())); } else { processError(new ServerException("Got no flashcards in response")); } }, this::processError); }
FlashcardsPresenter extends AbstractPresenter<IFlashcardsView> { public void onLoadFlashcards() { applyState(IFlashcardsView::showProgress); results.clear(); call = module.getFlashcards(); call.enqueue(data -> { if (data.getWords().size() != 0) { testData = data; applyState(view -> view.showWords(data.getWords())); } else { processError(new ServerException("Got no flashcards in response")); } }, this::processError); } }
FlashcardsPresenter extends AbstractPresenter<IFlashcardsView> { public void onLoadFlashcards() { applyState(IFlashcardsView::showProgress); results.clear(); call = module.getFlashcards(); call.enqueue(data -> { if (data.getWords().size() != 0) { testData = data; applyState(view -> view.showWords(data.getWords())); } else { processError(new ServerException("Got no flashcards in response")); } }, this::processError); } @Inject  FlashcardsPresenter(FlashcardsModule module, @Named(VIEW_EXECUTOR) Executor executor); }
FlashcardsPresenter extends AbstractPresenter<IFlashcardsView> { public void onLoadFlashcards() { applyState(IFlashcardsView::showProgress); results.clear(); call = module.getFlashcards(); call.enqueue(data -> { if (data.getWords().size() != 0) { testData = data; applyState(view -> view.showWords(data.getWords())); } else { processError(new ServerException("Got no flashcards in response")); } }, this::processError); } @Inject  FlashcardsPresenter(FlashcardsModule module, @Named(VIEW_EXECUTOR) Executor executor); @Override void onCreate(); @Override void onDestroy(); void onLoadFlashcards(); void onWordRight(FlashcardWord word); void onWordWrong(FlashcardWord word); void onCardsDepleted(); }
FlashcardsPresenter extends AbstractPresenter<IFlashcardsView> { public void onLoadFlashcards() { applyState(IFlashcardsView::showProgress); results.clear(); call = module.getFlashcards(); call.enqueue(data -> { if (data.getWords().size() != 0) { testData = data; applyState(view -> view.showWords(data.getWords())); } else { processError(new ServerException("Got no flashcards in response")); } }, this::processError); } @Inject  FlashcardsPresenter(FlashcardsModule module, @Named(VIEW_EXECUTOR) Executor executor); @Override void onCreate(); @Override void onDestroy(); void onLoadFlashcards(); void onWordRight(FlashcardWord word); void onWordWrong(FlashcardWord word); void onCardsDepleted();  }