In Nunit I can do something like this:
[TestFixture("param1")]
[TestFixture("param2")]
public class MyTestFixture
{
public MyTestFixture(string param) { /* more code */ }
/* more code */
}
After that all the tests and test cases inside class MyTestFixture
will run twice, using parameters from TestFixture
attributes one by one. Xunit doesn't use attribute TestFixture
, so how can I do similar thing without specifying those two parameters in each test inside InlineData
? If I do, it doubles the amount of attributes in my test code. I can write constructor with parameters, but I didn't find the way to pass data there. How do I do that?