Is there a way to write that I'm expecting a certain exception for certain inputs when I use the Factory attribute? I know how to do it using the Row attribute but I need it for dynamically generated test inputs.
See test example bellow for a function that returns the inverse of the provided string:
[TestFixture]
public class MyTestFixture()
{
private IEnumerable<object[]> TestData
{
get
{
yield return new object[] { "MyWord", "droWyM" };
yield return new object[] { null, null }; // Expected argument exception
yield return new object[] { "", "" };
yield return new object[] { "123", "321" };
}
}
[Test, Factory("TestData")]
public void MyTestMethod(string input, string expectedResult)
{
// Test logic here...
}
}