You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interfaceAinterfaceB : AclassFoo {
funconsume(a:A) { println(a) }
}
// in tests
@Test funtestMe() {
val mockFoo =MockFoo()
mockFoo.consume(object:A {})
verify { mockFoo.consume(isAny<A>()) }
// is equivalent to
verify { mockFoo.consume(isAny<B>()) }
// and both will be pass even if the param is not an instance of B
}
I expect the check isAny<B>() to fail when an instance that doesn't implement B is used.
I think isAny() should check the type instead of returning Success all the time, something like
I expect the check
isAny<B>()
to fail when an instance that doesn't implementB
is used.I think
isAny()
should check the type instead of returning Success all the time, something like(An alternative could be to provide a
isInstanceOf<T>()
next to isAny() if we don't want to change the current behavior.)The text was updated successfully, but these errors were encountered: