我创建了一个测试项目,发现的XCode生成一些名为测试类:为yourprojectname-ProjectTestsiOS和XCode的:了解自动测试
这是它的样子:
- (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 {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
会任何人都可以向我解释如何使用这些自动化测试方法?有关于此的官方文档吗?
这些测试是否意味着用作UI测试或应用程序代码测试?或两者?
链接到Apple文档(通过互联网搜索:https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/testing_with_xcode/Introduction/Introduction.html#//apple_ref/doc/uid/TP40014132 -CH1-SW1。还有一段来自WWDC 2014的视频:'#414 Testing in Xcode 6'(链接:https://developer.apple.com/videos/wwdc/2014/),我认为还有一个WWDC 2013视频 – 2015-02-11 00:54:19
查看[Xcode 7中的UI测试](http://masilotti.com/ui-testing-xcode-7),详细介绍了如何编写测试和使用框架 – 2015-06-29 15:01:22