Last active
March 10, 2017 19:20
-
-
Save ragdroid/0d0277d7cb0e34bfbe2f2ba49fcf266a to your computer and use it in GitHub Desktop.
Testing DataSource with Mockito
This file contains 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
@Inject PokeService pokemonService; | |
@Test | |
public void testGetPokemonAbilityStringObservable() { | |
PokeDataSource dataSource = new PokeDataSource(pokemonService); | |
TestObserver observer = new TestObserver(); | |
dataSource.getPokemonAbilityStringObservable("12") | |
.subscribe(observer); | |
observer.assertNoErrors(); | |
observer.awaitTerminalEvent(); | |
observer.assertComplete(); | |
observer.assertValue("Id: 12\n" + | |
"Name: butterfreeAbility Name : tinted-lens\n" + | |
" Is Hidden : true"); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment