package com.test.myapplication;

/**
 * Created by Indigo on 3/9/17.
 */

public class MainPresenterTest {
}

@@ -30,80 +30,994 @@
 n;%0A%0A
-/**%0A * Created by Indigo on 3/9/17.%0A */%0A%0Apublic class MainPresenterTest %7B
+import org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations;%0A%0Aimport rx.Observable;%0Aimport rx.schedulers.Schedulers;%0A%0Aimport static org.mockito.Mockito.when;%0A%0A/**%0A * Created by Indigo on 3/9/17.%0A */%0A%0Apublic class MainPresenterTest %7B%0A%0A    @Mock%0A    private CharactersDataSource charactersDataSource;%0A%0A    @Mock%0A    private MainContract.View view;%0A%0A    @Before%0A    public void setup() %7B%0A        MockitoAnnotations.initMocks(this);%0A    %7D%0A%0A    @Test%0A    public void fetchValidDataShouldLoadIntoView() %7B%0A%0A        CharactersResponseModel charactersResponseModel = new CharactersResponseModel(0, null, null, null);%0A%0A        when(charactersDataSource.getCharacters())%0A            .thenReturn(Observable.just(charactersResponseModel));%0A%0A        MainPresenter mainPresenter = new MainPresenter(%0A            this.charactersDataSource,%0A            Schedulers.immediate(),%0A            Schedulers.immediate(),%0A            this.view%0A        );%0A%0A    %7D%0A
 %0A%7D%0A

Test setup