You can use the [SetUpFixture]
attribute to instantiate a class before all tests are run. The constructor of this class will be called first. If this class implements IDisposable
, then the Dispose
method will be called after all tests are run.
Here's an example:
[SetUpFixture]
public class IntegrationSetUpFixture : IDisposable
{
public IntegrationSetUpFixture()
{
// runs before all tests
}
public void Dispose()
{
// runs after all tests
}
}