fatih
fatih

Reputation: 1181

Xcode unit test -- setup and teardown only once

Is it possible to setup a unit test class to call setup and teardown methods only once for all the test cases not for each test case?

Upvotes: 6

Views: 3775

Answers (2)

Jayprakash Dubey
Jayprakash Dubey

Reputation: 36447

Check this from Apple document

Flow of Execution for XCTest

Upvotes: 0

fatih
fatih

Reputation: 1181

Actually I found the answer. In order to do class level setup, one needs to implement +(void) setUp and +(void) tearDown. This class methods will be called before any test methods run and after all of the test methods run.

Upvotes: 16

Related Questions