any*
When creating a stub or verifying a call, Mockito provides many different argument matchers. Besides eq
, the most commonly used are the “any” family: any
, anyBoolean
, anyByte
, anyChar
, anyDouble
, anyFloat
, anyInt
, anyLong
, anyObject
, anyShort
, and anyString
. In MockK, these variations are all replaced by a single any
matcher.
// TODO example class that takes object, int, string parameters. Show stub & verify for both libs.
If you want to check for any null value, or any not-null value, the isNull
matcher can be used.
TODO: isNull()
, isNull(inverse = true)
TODO: ofType
当前内容版权归 Tiger Oakes 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Tiger Oakes .