对于方法签名
- (void)insertValue:(NSUInteger)value;
我正在尝试查看是否永远不会调用任何值的 insertValue 。
[verifyCount(test, never()) insertValue:0];
由于编译器抱怨任何()原始类型,我该如何测试呢?
对于方法签名
- (void)insertValue:(NSUInteger)value;
我正在尝试查看是否永远不会调用任何值的 insertValue 。
[verifyCount(test, never()) insertValue:0];
由于编译器抱怨任何()原始类型,我该如何测试呢?
就像https://stackoverflow.com/a/20524472/246895
[[verifyCount(test, never()) withMatcher:anything()]
insertValue:0];
OCMockito 使用 OCHamcrest 匹配器进行所有参数检查。通常,OCMockito 将原始参数转换为 NSNumber,然后将其包装在隐式 OCHamcrestequalTo
匹配器中。但是-withMatcher:
并-withMatcher:forArgument
替换隐式匹配器。