Search in sources :

Example 1 with RepositoryMvpView

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

the class RepositoryPresenterTest 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());
    repositoryPresenter = new RepositoryPresenter();
    repositoryMvpView = mock(RepositoryMvpView.class);
    when(repositoryMvpView.getContext()).thenReturn(application);
    repositoryPresenter.attachView(repositoryMvpView);
}
Also used : GithubService(uk.ivanc.archimvp.model.GithubService) RepositoryPresenter(uk.ivanc.archimvp.presenter.RepositoryPresenter) RepositoryMvpView(uk.ivanc.archimvp.view.RepositoryMvpView) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 GithubService (uk.ivanc.archimvp.model.GithubService)1 RepositoryPresenter (uk.ivanc.archimvp.presenter.RepositoryPresenter)1 RepositoryMvpView (uk.ivanc.archimvp.view.RepositoryMvpView)1