Created
March 22, 2020 16:10
-
-
Save mcatta/d468efa58dd1f95af6ff26a19154b18e to your computer and use it in GitHub Desktop.
Test rx java return
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 fetchDataViaRX with an empty result`() { | |
every { dataRepository.fetchDataWithRX() } returns Single.just(listOf()) | |
mainPresenter.fetchData() | |
val captureData = slot<List<UiDataModel>>() | |
verify(exactly = 1) { view.onResult(capture(captureData)) } | |
captureData.captured.let { res -> | |
assertNotNull(res) | |
assert(res.isEmpty()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment