How to generate NUnit fixtures programmatically?
Posted
by pmezard
on Stack Overflow
See other posts from Stack Overflow
or by pmezard
Published on 2010-04-22T09:12:49Z
Indexed on
2010/04/22
9:13 UTC
Read the original article
Hit count: 255
Hello,
Say I have a test like:
void TestSomething(int someParam)
{
// Test code
}
I would like to execute this test with a set of "someParam" values. I could write explicit [Test] fixtures calling TestSomething() with the parameters, which means having N methods for every TestSomething() method. I could write another [Test] method looping on "someParam" values and calling TestSomething(), it means 2 methods for every test, and the test report is not as good as with individual TestSomethingWithXValue() methods.
So, is there any way to programmatically generate fixtures for every test methods and input values?
© Stack Overflow or respective owner