2
votes

Like most unit testing frameworks, SenTestCase has setUp and tearDown methods you can override to run code before and after each test.

In NUnit, I'm used to having a fixure setup and fixture teardown method I can override, too, that will let me run code once before any test is run, and clean up once after all tests in the fixture are run.

What's the proper way to do this with SenTestCase? I tried using init and dealloc for this, against my better jugment, but it seemed like my init override was never called.

2

2 Answers

2
votes

You can use the +setUp and +tearDown class methods: SenTestKit: cleaning up after ALL tests have run?.

0
votes

I've switched to GHUnit, which has this feature. As far as I can tell OCUnit/SenTestCase does not.