Skip to content

Instantly share code, notes, and snippets.

@gilgoldzweig
Last active February 12, 2019 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilgoldzweig/cd16b6365417b2b6fadba87a71623350 to your computer and use it in GitHub Desktop.
Save gilgoldzweig/cd16b6365417b2b6fadba87a71623350 to your computer and use it in GitHub Desktop.
class ExamplePresenterTest {
//Setup code...
@Test
fun `test_fetchProfileName_calles_onProfileRequestFailed_on_exception`() {
val fakeException = Mockito.mock(IOException::class.java)
Mockito.`when`(presenter.fetchProfileNameFromRepository()))
.thenThrow(fakeException)
presenter.fetchProfileName()
Mockito.verify(view, times(1))
.onProfileNameRequestFailed(fakeException)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment