Reputation: 3481
We are using NUnit to run a large number of integration tests.
All these tests share a base class, which as a test fixture setup method that preps the data needed for the rest of the tests.
Is there any way to stop running tests if there is a failure in the test fixture setup?
Right now it waits until all the tests fail with the same setup error
Upvotes: 0
Views: 1682
Reputation: 21357
If I understand you correctly can't you just throw an exception somewhere in your [Setup] method or [SetupFixture] class if you encountered a failure?
The test runner will still report as if all of your tests failed, but don't let that confuse you into thinking they were run. NUnit will effectively terminate as soon as it encounters the exception.
Upvotes: 3