Simon Lin
01/07/2021, 9:53 AMinit block
?
the sample:
class Foo() {
init {
loadData()
}
private fun loadData() {
repository.getData()
}
}
And this is what I done. Is it correct?
class FooTest {
private val foo by lazy { Foo() }
@Test
fun `test foo init block`() {
foo // access foo to create an instance by Lazy
coVerify(exactly = 1) { repository.getData() }
}
}
tddmonkey
01/07/2021, 10:18 AMDaniel
01/07/2021, 10:37 AMEmil Kantis
01/09/2021, 10:49 AMrepository.getData()
and verify that the data has been loaded as expected, if possible 🙂