Skip to content

Instantly share code, notes, and snippets.

@Raiden18
Last active July 21, 2022 19:23
Show Gist options
  • Save Raiden18/b8c6071afb2ba88159677a73a5589e89 to your computer and use it in GitHub Desktop.
Save Raiden18/b8c6071afb2ba88159677a73a5589e89 to your computer and use it in GitHub Desktop.
@Test
fun `Should show content state if user clicks on retry button after loading data with error`() = runTest {
val throwable = Throwable()
val viewModel = ViewModelBuilder()
.withDataLoadedWithError(throwable)
.build(testScheduler)
//Replaced with Cases
Cases(viewModel)
.nowDataIsLoadedSuccessfully(dataToLoad))
.userClicksOnRetryButton()
assertThat(viewModel)
.contentIsShow(dataToLoad)
.loaderIsHidden()
.errorIsHidden()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment