What is the proper syntax to use when trying to implement the SetUpFixture ability in Nunit. This is what I have but I keep getting an error:
namespace Testing
{
[SetUpFixture, RequiresSTA]
public class SetupClass
{
public IE CASsite = new IE("awebsite");
[SetUp]
public void Setup()
{
}
[TearDown]
public void TearDown()
{
CASsite.Dispose();
}
}
[TestFixture, RequiresSTA]
public class Tests : SetupClass
{
[Test]
public void DoSomething()
{
}
}
}
The error I keep receiving is : Failure: TestFixtureSetUp failed in SetupClass
Do you have more than one
SetUpFixturedefined for your namespaceTesting?Per the docs,
Your
Testsclass derives from yourSetUpFixtureclass. You don’t need to do that. TheSetUpFixtureclass’SetUpandTearDownwill run automatically for all classes in that namespace.