iOS?????????????
?????runtime_ ???????[ 2016/10/18 11:06:15 ] ?????????????? ???????
????????????????????????????????????
?????????????????????У?????????????????????У?????????????????????????????
????????????ж????????е?????????
?????????????????????????????????????????????????????????????????????????У?У?鷵??????
????Demo ?????????????????????
????1?????????XCTestExpectation????
????2????????XCTestExpectation??????????????????????????????????????????????
????3?????????????????
????4???????????????
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import "NSObject+YPApiService.h"
#import "YPApiServiceKit.h"
@interface YouPiaoTests : XCTestCase<YPApiServiceKitDataSource>
@property (nonatomic??strong) XCTestExpectation *e;
@end
@implementation YouPiaoTests
- (void) testIndexList {
// 1 ????XCTestExpectation????
XCTestExpectation *e = [self expectationWithDescription:@"des"];
// 2 ???????????
self.e = e;
// 3 ????????????
[self api_Post_IndexList];
// 4 ??? XCTestExpectation??????fulfill?????????????????????
[self waitForExpectationsWithTimeout:10 handler:^(NSError * _Nullable error) {
NSLog(@"%@"??error);
}];
}
// ??????????????????????
- (void)serverResponseSuccess:(YPBaseModel *)responseModel {
NSLog(@"%@"??responseModel);
[self.e fulfill];
}
@end
??????????
??????????????????????????
????????
????self expectationForNotification:@"RSBaseTest" object:nil handler:nil];
??????????
????[self waitForExpectationsWithTimeout:30 handler:nil];} while (0);
??????????
????[[NSNotificationCenter defaultCenter]postNotificationName:@"RSBaseTest" object:nil];
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11