Steve
03/16/2020, 6:19 PMSteve
03/16/2020, 6:20 PMoverride suspend fun validate(thingy: String): Result {
return try {
webClient.validate(thingy)
} catch(e: Exception) {
offlineValidator.validate(thingy)
}
}Steve
03/16/2020, 6:24 PM@Test
fun testOfflineValidation() = mainCoroutineRule.runBlockingTest {
val result = sut.validate("stuff")
}streetsofboston
03/16/2020, 6:29 PMException or a Throwable.?Steve
03/16/2020, 6:33 PMthrow Exception() . The real one is going to use Retrofit, so I'm not sure what it doesstreetsofboston
03/16/2020, 6:35 PMSteve
03/16/2020, 6:36 PMSteve
03/16/2020, 6:41 PM