Slide 59
Slide 59 text
@Test fun `at first lunch, should start on empty state`() {
whenActivityResumed {
assertThat(screen.isLinked).isTrue()
val expectedStates = listOf(Idle, Loading, FactsScreenState.Empty)
assertThat(screen.trackedStates).isEqualTo(expectedStates)
}
}
// More tests
@Test fun `when remote service fails, should display the error`() {
restInfrastructure.restScenario(status = 503)
PersistanceHelper.registerNewSearch("code")
whenActivityResumed {
val error = Failed(RemoteServiceIntegrationError.RemoteSystem)
val expectedStates = listOf(Idle, Loading, error)
assertThat(screen.trackedStates).isEqualTo(expectedStates)
}
}
} https://github.com/dotanuki-labs/norris