Reputation: 1181
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
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