eq
By default, Mockito verifies argument values by using the equals()
method, which corresponds to ==
in Kotlin.
verify(mock.containsAll(listOf("a", "b"), true))
However, once argument matchers like any()
are used, then the eq
argument matcher must be used for literal values.
verify(mock.containsAll(eq(listOf("a", "b")), anyBoolean()))
In MockK, eq
is always used as the default argument matcher. You can mix literal values with any
without issue.
verify { mock.containsAll(listOf("a", "b", any())) }
TODO:
refEq
same
当前内容版权归 Tiger Oakes 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Tiger Oakes .