Skip to content

Instantly share code, notes, and snippets.

@CostaFot
Last active February 7, 2020 00:34
Show Gist options
  • Save CostaFot/11131b0cf36a6a40ea94babad4aa9be9 to your computer and use it in GitHub Desktop.
Save CostaFot/11131b0cf36a6a40ea94babad4aa9be9 to your computer and use it in GitHub Desktop.
@Test
fun `getPost actually returns the post I am expecting`() {
// run the test on the testDispatcher provided by the coroutineTestRule
coroutineTestRule.testDispatcher.runBlockingTest {
// Given
val expectedPost: State.Post = State.Post("I hope this post gets me karma points")
// When
val actualPost: State.Post = redditRepository.getPost()
// Then
assertEquals(expectedPost, actualPost)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment