Suppose I have a test method like so:
[TestMethod]
[DataRow( 0, 0, 0 )]
[DataRow( 0, 0, 1 )]
[DataRow( 0, 1, 0 )]
[DataRow( 0, 1, 1 )]
[DataRow( 1, 0, 0 )]
[DataRow( 1, 0, 1 )]
[DataRow( 1, 1, 0 )]
[DataRow( 1, 1, 1 )]
public void ReallyCoolTest( int a, int b, int c )
{
// some really cool test code that uses a, b, and c
}
This tests against all combinations of a, b, & c equaling 0 or 1. Just two values in three parameters and it takes 8 DataRow lines!
What I'd really love to do is something like this:
[TestMethod]
[DataMatrix( {0,1}, {0,1}, {0,1} )]
public void ReallyCoolTest( int a, int b, int c )
{
// some really cool test code that uses a, b, and c
}
I'd like to specify some values for each parameter and have all combinations tested. Is there anything like that using MS test?
Note: I am aware of the DataSource attribute. However, I'd like to have the values in-code and not in an external file.