Daily iOS
Testing

XCTest lifecycle

In the XCTestCase below, which order are the calls made in when testA and testB run?

final class CartTests: XCTestCase {
    override class func setUp() { /* 1 */ }
    override func setUp() { /* 2 */ }
    override func tearDown() { /* 3 */ }
    override class func tearDown() { /* 4 */ }
    func testA() {}
    func testB() {}
}

Pick one

Submit