3

Is there an NUnit's TestCaseAttribute equivalent in Visual Studio 2008 unit test framework?

You know, something like this:

[TestCase(1, 1, 1)]
[TestCase(2, 2, 2)]
[TestCase(3, 3, 3)]
public void Test1(int a, int b, int c) 
{ 
    // do stuff depending on the TestCase 
}
abatishchev
  • 98,240
  • 88
  • 296
  • 433
Pedro
  • 11,514
  • 5
  • 27
  • 40
  • possible duplicate of [Does MSTest Have an Equivalent to NUnits TestCase](http://stackoverflow.com/questions/1010685/does-mstest-have-an-equivalent-to-nunits-testcase) – Nathan Koop Dec 01 '11 at 20:17

1 Answers1

2

MSTest unfortunately doesn't support parameterized tests in this way. The closest you get is with the DataSource attribute, which allows you to specify an external data source for the test method.

Mark Seemann
  • 225,310
  • 48
  • 427
  • 736