[Test]
[TestCase(1, ExpectedException = typeof(Exception), ExpectedMessage = "bad parameter 1")]
[TestCase(2, ExpectedException = typeof(Exception), ExpectedMessage = "bad parameter 2")]
[TestCase(3)]
public void TestSomething(int mode)
{
...
}
[TestCase(1, ExpectedException = typeof(Exception), ExpectedMessage = "bad parameter 1")]
[TestCase(2, ExpectedException = typeof(Exception), ExpectedMessage = "bad parameter 2")]
public void TestSomethingThatFails(int mode, Type expectedException, string expectedMessage)
{
Assert.That(() => TestSomething(), Throws.Exception // ...
}
[TestCase(3)]
public void TestSomethingThatPasses(int mode)
{
...
}
--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nunit-discus...@googlegroups.com.
To post to this group, send email to nunit-...@googlegroups.com.
Visit this group at http://groups.google.com/group/nunit-discuss.
For more options, visit https://groups.google.com/d/optout.
[TestCase(1, typeof(Exception), "bad parameter 1")]
[TestCase(2, typeof(Exception), "bad parameter 2")]