Search in sources :

Example 1 with MainMvpView

use of uk.ivanc.archimvp.view.MainMvpView in project archi by ivacf.

the class MainPresenterTest method setUp.

@Before
public void setUp() {
    ArchiApplication application = (ArchiApplication) RuntimeEnvironment.application;
    githubService = mock(GithubService.class);
    // Mock the retrofit service so we don't call the API directly
    application.setGithubService(githubService);
    // Change the default subscribe schedulers so all observables
    // will now run on the same thread
    application.setDefaultSubscribeScheduler(Schedulers.immediate());
    mainPresenter = new MainPresenter();
    mainMvpView = mock(MainMvpView.class);
    when(mainMvpView.getContext()).thenReturn(application);
    mainPresenter.attachView(mainMvpView);
}
Also used : GithubService(uk.ivanc.archimvp.model.GithubService) MainMvpView(uk.ivanc.archimvp.view.MainMvpView) MainPresenter(uk.ivanc.archimvp.presenter.MainPresenter) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 GithubService (uk.ivanc.archimvp.model.GithubService)1 MainPresenter (uk.ivanc.archimvp.presenter.MainPresenter)1 MainMvpView (uk.ivanc.archimvp.view.MainMvpView)1