What is the purpose of XCTestCase's setUp method?

后端 未结 2 858
余生分开走
余生分开走 2020-12-14 14:52

Per the comment within the default template for XCTestCase regarding setUp :

Put setup code here; it will be run once, before the fir

2条回答
  •  醉梦人生
    2020-12-14 15:27

    I came here with almost the same problem: how to perform the setUp just once and in Swift. Here is the solution:

    override class func setUp() {
        super.setUp()    
        // ...
    }
    
    override class func tearDown() {    
        // ...
        super.tearDown()
    }
    

    Right now I'm still looking for a solution for an asynchronous setUp!

提交回复
热议问题