@Test public void testRefreshError() throws Exception { when(mNewsView.isRefreshing()).thenReturn(true); when(mDataManager.getAllNewses(mNewsView.getItemOffset())) .thenReturn(Single.error(mock(HttpException.class))); mPresenter.onRefresh(); verify(mNewsView).showRefreshErrorAndComplete(); }
public void onRefresh() { getDisposable().clear(); final INewsView view = getView(); if (!view.isRefreshing()) { view.changeStateView(MultiStateView.VIEW_STATE_LOADING); } loadTopics(true); }
NewsPresenter extends BasePresenter<INewsView> { public void onRefresh() { getDisposable().clear(); final INewsView view = getView(); if (!view.isRefreshing()) { view.changeStateView(MultiStateView.VIEW_STATE_LOADING); } loadTopics(true); } }
NewsPresenter extends BasePresenter<INewsView> { public void onRefresh() { getDisposable().clear(); final INewsView view = getView(); if (!view.isRefreshing()) { view.changeStateView(MultiStateView.VIEW_STATE_LOADING); } loadTopics(true); } @Inject  NewsPresenter(DataManager dataManager); }
NewsPresenter extends BasePresenter<INewsView> { public void onRefresh() { getDisposable().clear(); final INewsView view = getView(); if (!view.isRefreshing()) { view.changeStateView(MultiStateView.VIEW_STATE_LOADING); } loadTopics(true); } @Inject  NewsPresenter(DataManager dataManager); @Override void onAttach(INewsView view); void onRefresh(); void loadMore(); @Override void onDetach(); }
NewsPresenter extends BasePresenter<INewsView> { public void onRefresh() { getDisposable().clear(); final INewsView view = getView(); if (!view.isRefreshing()) { view.changeStateView(MultiStateView.VIEW_STATE_LOADING); } loadTopics(true); } @Inject  NewsPresenter(DataManager dataManager); @Override void onAttach(INewsView view); void onRefresh(); void loadMore(); @Override void onDetach();  }