using mockk for testing kotlin function.
private val serviceObject = mockk<Service>()
private val serviceToBeTested = ServiceToBeTestd(Service)
fun test(){
when(serviceObject.function1(argument1,argument1))
.thenReturn(<something>)
}
When i try to run it, i get this error:
io.mockk.MockKException: no answer found for: Service(#1).function1(argument1, argument2)
Any idea why ?
ServiceToBeTest是要测试的服务,服务通过有线连接:
open class ServiceToBeTestd
constructor(private val service: Service)