【发布时间】:2015-08-03 11:16:18
【问题描述】:
我的应用中有以下方法,我需要为其编写单元测试用例。
谁能建议我如何测试是否调用了成功块或错误块。
- (IBAction)loginButtonTapped:(id)sender
{
void (^SuccessBlock)(id, NSDictionary*) = ^(id response, NSDictionary* headers) {
[self someMethod];
};
void (^ErrorBlock)(id, NSDictionary*, id) = ^(NSError* error, NSDictionary* headers, id response) {
// some code
};
[ServiceClass deleteWebService:@“http://someurl"
data:nil
withSuccessBlock:SuccessBlock
withErrorBlock:ErrorBlock];
}
【问题讨论】:
标签: ios iphone unit-testing ocmockito