The method will be called two times with different parameters:
method("test1")
method("test2")
In my test I am trying to check if the parameters are right or not
`when`(
mockClass.method(
anyObject()
)
).then { param ->
val value: Class = param.arguments[0] as Class
assert(value == "test1")
}
`when`(
mockClass.method(
anyObject()
)
).then { param ->
val value: Class = param.arguments[0] as Class
assert(value == "test2")
}
I understand why it is not working but is there a proper way to verify the same method two times?
I am trying to verify the same method which will be called two times with different parameters and want to check if are given parameters are right?