- (void)testAsync {
//设置预期
XCTestExpectation *expactation = [self expectationWithDescription:@"异步测试"];
[Person loadPersonAsync:^(Person *person) {
NSLog(@"%@",person);
//预期达成
[expactation fulfill];
}];
//预期超时等待
[self waitForExpectationsWithTimeout:10 handler:nil];
}
iOS单元测试中测试异步方法
最新推荐文章于 2020-10-13 23:57:26 发布
1318

被折叠的 条评论
为什么被折叠?



