0
メソッドシグネチャ:OCMockitoブロックをキャプチャして他のプリミティブな引数とマッチさせる方法は?
- (void)updateFeaturesButtons:(NSInteger)gameId
category:(FeatruesCategory)category
parentId:(NSInteger)parentId
success:(void (^)(NSDictionary* featuresJson))success
failure:(void (^)(NSError* error))failure
私は成功ブロック引数をキャプチャし、そのような他の引数を無視しよう:
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!
エラーです。 他の議論のために私は何ができますか?
指定する必要がありますが、私はwithMatcher' 'と2つの以上の引数にマッチする任意の例を見ません。それは動作します、ありがとう! – ccnyou