Last active
March 10, 2017 19:21
-
-
Save ragdroid/bd44e62809834d9998b76c790676baee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Mock MainView mainViewMock; | |
@Mock PokeDataSource pokeDataSource; | |
@Test | |
public void testOnViewAdded() { | |
reset(mainViewMock); | |
MainPresenterImpl presenter = new MainPresenterImpl( | |
schedulersProvider, pokeDataSource); | |
when(pokeDataSource.getPokemonAbilityStringObservable(anyString())) | |
.thenReturn(Observable.just("")); | |
presenter.onViewAdded(mainViewMock, null); | |
testScheduler.triggerActions(); | |
verify(mainViewMock, times(1)).setApiText(anyString()); | |
verify(mainViewMock, times(0)).showErrorDialog(anyString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment