Created
March 22, 2020 15:54
-
-
Save mcatta/3839aa24efade18bba3a5b1bec74fe1b to your computer and use it in GitHub Desktop.
Test an exception
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
@Test | |
fun `Test fetchData with an exception`() { | |
every { dataRepository.fetchData() } throws IllegalStateException("Houston we have a problem") | |
mainPresenter.fetchData() | |
verify(exactly = 0) { view.onResult(any()) } | |
verify(exactly = 1) { view.onError(any()) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment