单元测试 UnitTest
作者:
EdenChow | 来源:发表于
2017-04-12 11:00 被阅读13次一个网络测试例子 (参考AFN项目的测试用例)
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
AFHTTPSessionManager *_mag = [AFHTTPSessionManager manager];
[_mag
GET:@"https://api.douban.com/v2/book/1220562" parameters:nil
progress:nil
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
XCTAssertNotNil(responseObject);
[expectation fulfill];
}
failure:nil];
[self waitForExpectationsWithTimeout:3.0 handler:nil];
本文标题:单元测试 UnitTest
本文链接:https://www.haomeiwen.com/subject/xctmattx.html
网友评论