We use NUnit to execute integration tests. These tests are very time consuming. Often the only way to detect a failure is on a timeout.
I would like the tests to stop executing as soon as a single failure is detected.
Is there a way to do this?
We use NUnit to execute integration tests. These tests are very time consuming. Often the only way to detect a failure is on a timeout.
I would like the tests to stop executing as soon as a single failure is detected.
Is there a way to do this?
This is probably not the ideal solution, but it does what you require i.e. Ignore remaining tests if a test has failed.
Since TestFixtureAttribute is inheritable, so you could potentially create a base class with this attribute decorated on it and have the Ascertain protected Method in it and derive all TestFixture classes from it.
The only downside being, you'll have to refactor all your existing Assertions.
I'm using NUnit 3 and the following code works for me.
Alternatively you could make this an abstract class and derive from it.
Using nunit-console, you can achieve this by using the /stoponerror command line parameter.
See here for the command line reference.