?????????????????????????????
????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??-???");
}