如何在 mockk 中模拟 Build.VERSION.SDK_INT?
我做了以下事情:
@Test
fun testFoo(){
mockkStatic(Build::class)
mockkStatic(Build.VERSION::class)
every {
Build.VERSION.SDK_INT
} answers { 22 }
}
io.mockk.MockKException: Missing calls inside every { ... } block.
一旦代码遇到问题,我最终会得到every
。