- (int)getValue{ static int value = 1; value +=1; NSLog(@"test 2 value:%d",value); return value; } - (void)doTest:(int)value expect:(int)expect{ int doubleValue = [self.viewController doubleValue:value]; XCTAssertTrue(expect == doubleValue, @"期望值:%d,实际值:%d",expect,doubleValue); } - (void)testDoubleValue{ for (int count = 0; count < 10; count++) { int value = [self getValue]; [self doTest:value expect:value*2]; } } |