📅  最后修改于: 2022-03-11 14:55:02.447000             🧑  作者: Mango
object MockObj {
fun add(a: Int, b: Int) = a + b
}
mockkObject(MockObj) // applies mocking to an Object
assertEquals(3, MockObj.add(1, 2))
every { MockObj.add(1, 2) } returns 55
assertEquals(55, MockObj.add(1, 2))