Last active
January 21, 2019 06:48
-
-
Save michalbujalski/6be9cd5148c29301068e1d371a15f033 to your computer and use it in GitHub Desktop.
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 `fetch contacts, api error`(){ | |
//given | |
val errorMessage = "Bad request" | |
whenver(api.fetchContacts()).thenReturn{Single.error(IllegalArgumentException(errorMessage)} | |
//when | |
presenter.fetchContacts() | |
//then | |
val inOrder = inOrder(view, api) | |
inOrder.verify(view).showProgress() | |
inOrder.verify(api).fetchContacts() | |
inOrder.verify(view).hideProgress() | |
inOrder.verify(view).showError(anyList) | |
inOrder.verifyNoMoreInteractions() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment