org.hamcrest.Matchers 类的方法签名

本文详细介绍了org.hamcrest.Matchers类中各种匹配器方法的使用,包括字符串、集合、数组等类型的匹配方法,为单元测试提供强大的断言支持。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

org.hamcrest.Matchers 类的方法签名

方法名返回类型
startsWithorg.hamcrest.Matcher<kotlin.String!>!
endsWithorg.hamcrest.Matcher<kotlin.String!>!
containsorg.hamcrest.Matcher<kotlin.collections.(Mutable)Iterable<E!>!>!
arrayorg.hamcrest.collection.IsArray<T!>!
emptyorg.hamcrest.Matcher<(kotlin.collections.MutableCollection<out E!>..kotlin.collections.Collection<E!>?)>!
allOforg.hamcrest.Matcher<T!>!
hasSizeorg.hamcrest.Matcher<(kotlin.collections.MutableCollection<out E!>..kotlin.collections.Collection<E!>?)>!
containsStringorg.hamcrest.Matcher<kotlin.String!>!
equalToorg.hamcrest.Matcher<T!>!
hasPropertyorg.hamcrest.Matcher<T!>!
hasValueorg.hamcrest.Matcher<(kotlin.collections.MutableMap<, out V!>..kotlin.collections.Map<, V!>?)>!
theInstanceorg.hamcrest.Matcher<T!>!
isorg.hamcrest.Matcher<T!>!
notorg.hamcrest.Matcher<T!>!
emptyArrayorg.hamcrest.Matcher<kotlin.Array<(out) E!>!>!
anyorg.hamcrest.Matcher<T!>!
nullValueorg.hamcrest.Matcher<kotlin.Any!>!
greaterThanorg.hamcrest.Matcher<T!>!
lessThanorg.hamcrest.Matcher<T!>!
bothorg.hamcrest.core.CombinableMatcher.CombinableBothMatcher<LHS!>!
greaterThanOrEqualToorg.hamcrest.Matcher<T!>!
lessThanOrEqualToorg.hamcrest.Matcher<T!>!
anythingorg.hamcrest.Matcher<kotlin.Any!>!
anyOforg.hamcrest.core.AnyOf<T!>!
isOneOforg.hamcrest.Matcher<T!>!
isAorg.hamcrest.Matcher<T!>!
hasKeyorg.hamcrest.Matcher<kotlin.collections.(Mutable)Map<out K!, *>!>!
hasItemorg.hamcrest.Matcher<kotlin.collections.(Mutable)Iterable<*>!>!
hasItemsorg.hamcrest.Matcher<kotlin.collections.(Mutable)Iterable<T!>!>!
eitherorg.hamcrest.core.CombinableMatcher.CombinableEitherMatcher<LHS!>!
hasEntryorg.hamcrest.Matcher<(kotlin.collections.MutableMap<out K!, out V!>..kotlin.collections.Map<out K!, V!>?)>!
describedAsorg.hamcrest.Matcher<T!>!
everyItemorg.hamcrest.Matcher<kotlin.collections.(Mutable)Iterable<U!>!>!
instanceOforg.hamcrest.Matcher<T!>!
notNullValueorg.hamcrest.Matcher<kotlin.Any!>!
sameInstanceorg.hamcrest.Matcher<T!>!
hasItemInArrayorg.hamcrest.Matcher<kotlin.Array<(out) T!>!>!
arrayContainingorg.hamcrest.Matcher<kotlin.Array<(out) E!>!>!
arrayContainingInAnyOrderorg.hamcrest.Matcher<kotlin.Array<(out) E!>!>!
arrayWithSizeorg.hamcrest.Matcher<kotlin.Array<(out) E!>!>!
emptyCollectionOforg.hamcrest.Matcher<kotlin.collections.(Mutable)Collection<E!>!>!
emptyIterableorg.hamcrest.Matcher<kotlin.collections.(Mutable)Iterable<E!>!>!
emptyIterableOforg.hamcrest.Matcher<kotlin.collections.(Mutable)Iterable<E!>!>!
containsInAnyOrderorg.hamcrest.Matcher<kotlin.collections.(Mutable)Iterable<T!>!>!
iterableWithSizeorg.hamcrest.Matcher<kotlin.collections.(Mutable)Iterable<E!>!>!
isInorg.hamcrest.Matcher<T!>!
closeToorg.hamcrest.Matcher<kotlin.Double!>!
comparesEqualToorg.hamcrest.Matcher<T!>!
equalToIgnoringCaseorg.hamcrest.Matcher<kotlin.String!>!
equalToIgnoringWhiteSpaceorg.hamcrest.Matcher<kotlin.String!>!
isEmptyStringorg.hamcrest.Matcher<kotlin.String!>!
isEmptyOrNullStringorg.hamcrest.Matcher<kotlin.String!>!
stringContainsInOrderorg.hamcrest.Matcher<kotlin.String!>!
hasToStringorg.hamcrest.Matcher<T!>!
typeCompatibleWithorg.hamcrest.Matcher<java.lang.Class<*>!>!
eventFromorg.hamcrest.Matcher<java.util.EventObject!>!
samePropertyValuesAsorg.hamcrest.Matcher<T!>!
hasXPathorg.hamcrest.Matcher<org.w3c.dom.Node!>!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值