Reputation: 60001
Does NUnit let me invoke a method after every test method?
e.g.
class SomeClass
{
[SomeNUnitAttribute]
public void CalledAfterEveryTest()
{
}
}
I'm aware of [SetUp] and [TearDown], but that only works for the tests in the current class. I want something like [TearDown], except it runs after every unit test, whether its in the current class or not. Possible?
Upvotes: 1
Views: 393
Reputation:
The [TearDown] Attribute marks the cleanup method.
If you want it for multiple classes I believe you can add the teardown method to a base class and inherit from that in every test class that needs the teardown behaviour.
Upvotes: 5