【发布时间】:2014-08-03 02:47:05
【问题描述】:
我正在学习 Xcode 中的单元测试。 Xcode 为我生成了模板,但是当我添加一个新的测试方法时它没有运行。 为什么?我已经疯了。我不知道为什么,我找不到任何解决方案。
#import <XCTest/XCTest.h>
@interface TesttestTests : XCTestCase
@end
@implementation TesttestTests
-(void)setUp
{
[super setUp];
// 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.
[super tearDown];
}
-(void)testExample
{
XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}
-(void)newtest{
XCTAssert(false, @"This'll be false");
}
所以我添加了最后一个方法,但我的测试类无法识别它。为什么?
【问题讨论】:
标签: ios xcode unit-testing methods