0
方法签名:OCMockito如何捕获块并匹配任何其他原始参数?
- (void)updateFeaturesButtons:(NSInteger)gameId
category:(FeatruesCategory)category
parentId:(NSInteger)parentId
success:(void (^)(NSDictionary* featuresJson))success
failure:(void (^)(NSError* error))failure
我试图捕捉成功block参数,而忽略其他参数那样:
HCArgumentCaptor* captor = [[HCArgumentCaptor alloc] init];
[verify(mockManager) updateFeaturesButtons:0 category:0 parentId:0 success:(id)captor failure:anything()];
我只是想叫成功阻滞的json:
SuccessBlock block = captor.value;
block(json);
但我得到的只是argument(s) are different!
错误。 我可以为其他参数做些什么?
我看了ocmockito文档,但我看不出有什么例子来匹配多于2个参数用'withMatcher'。它的工作原理,谢谢! – ccnyou