Hi,
in the current NUnit version, I can parameterized TestFixture and instantiated it multiple times. E.g.:
[TestFixture("var1")]
[TestFixture("var2")]
[TestFixture("var3")]
public class MyTestFixture
{
private string var;
public MyTestFixture(string var)
{
this.var = var;
}
...
}
This will instantiate the MyTestFixture 3 times with the argument parameter. My problem is the current NUnit doesn't have datasource feature for TextFixture attribute (only TestCaseSource). I need to instantiate the TestFixture based on the data input, and each TestFixture has a different sets of test case data input. No problem with the Test case data driven, thanks to the TestCaseSource. But how can I do this for the TestFixture attribute?
My idea is to generate the TestFixture attribute on the fly then change it to code string and insert into the test code, e.g.: something like this:
ConvertToCode(GenerateTestFixture());
public class MyTestFixture
{
...
}
How can I do this? Or are there a better way?
Thank you very much for your help.
Best regards,
Edward