Hi,
I have some initialization code to use my API. The initialization may fail and I´d like to test it in an NUnit test.
After the initialization the API may be used. I´m testing the API too, but all my test methods will use the same, common, initialization code.
What I would ideally like is if this behavior:
- The Initialization test is run.
- The other tests are run if [1] succeeded.
In all cases where [1] will fail, so will all other tests. But the valuable information is that [1] fails. That's where I most likely will find the problem. It would be nice if the other tests could be marked with ? or something, indicating that they did not execute as functionality they depend on didn't pass the tests.
I know that tests should not be brittle. But I can't get around the fact that the initialization code is necessary for correct execution of other functionality.
This is a more general problem where some functionality depends on other functionality. Where the "other functionality" is far too commonly used to provide any real value by failing all tests depending on it. It would be better if the "other functionality" would be tested separately.