??iOS???????
?????AllanHou ???????[ 2017/5/9 10:23:27 ] ??????????????? ???????
?????????????????????????????
????1.?????????
????2.????????XCTest
????3.????????????????????????
????4.???????
?????.?????????
?????????????????????д??????????????????????????????Σ??????????????????????????????????????????????????
??????????????????????????飬?????????????????????????????????????????????????????????QA????????????ЩQA????????bug?????????gg?????????????????????????????????????????????????????????????????
??????.????????XCTest
?????????Xcode7?м?????XCTest??????????????????????????????????????????1??
????
?1.??????????
?????????????????????????ж?????????????demoTests??????????????????????д?????????????????2??
????
?2.??????
???????????????????????????棬?????????????????????????????????????????????????????????????????????????????????????Unit Test Case Class???????3??
????
?3.?????????????
???????PersonalInformationTests.m??????.m?л??м???????????????????????
#import
@interfacePersonalInformationTests :XCTestCase
@end
@implementationPersonalInformationTests
/** ?????????????? */
- (void)setUp {
[supersetUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
/** ??????????????? */
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[supertearDown];
}
/** ??????????д????test?????????? ????test????????????????????????????????????м???test?????????? */
- (void)testExample {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
/** ???????? */
- (void)testPerformanceExample {
// This is an example of a performance test case.
[selfmeasureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end
????????????????????????age??????????ResponsePersonalInformation.h ??.m???????????????????????????????age????value?????????е???????
????#import (Foundation/Foundation.h)(??????????????????滻?????????)
????@interface ResponsePersonalInformation : NSObject
????@property (nonatomic?? copy) NSString * age;
????@end
??????PersonalInformationTests??????ResponsePersonalInformation.h??????testPersonalInformationAge??????checkAge?????????????checkAge???????????XCTAssert?????????????????п??????NSLog?????????????????????????????????????????????к?????????????????????????????????????????
???????????????????ж????????????????????????????????????????????????????????????????????????XCTAssert?????к?????????????????????????? ??????? ??????????
- (void)testPersonalInformationAge
{
ResponsePersonalInformation * response = [[ResponsePersonalInformation alloc] init];
response.age = @"20"; //????????? 0 < age < 110???????????
[self checkAge:response];
}
- (void)checkAge:(ResponsePersonalInformation *)response
{
XCTAssert([response.age integerValue] < 0?? @"????С??0??-???");
XCTAssert([response.age integerValue] >110?? @"????????110??-???");
}
??????
???·???
??????????????????
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