如何模拟以下函数 act
。
class Some {
internal lateinit var coroutineScope: LifecycleCoroutineScope
...
fun act() {
coroutineScope.launch {
...
}
}
}
我正在使用 mockk
和 kotlinx-coroutines-test
对此进行单元测试。但它只能模拟 CoroutineScope
而不能模拟 LifecycleCoroutineScope
。