自 Xcode 10.1(可能是 10)以来,当我创建单元测试文件时,我没有调用 super.tearDown() 和 super.setUp() 。
我在发行说明中没有看到这样的变化。
所以我的问题是我还应该写 super.tearDown() 和 super.setUp() 吗?
class SomethingTests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}