I am using NUnit 2.5, and I want to test a method that recieves several parameters.
Is it reasonable to try to test them using one Test method, with several different TestCases, or will it be harder to maintain (Or just pin point the exact failure) in the long run?
My general idea is to try something like
[TestCase("valid", Result="validasd",
Description = "Valid string test, expecting valid answer")]
[TestCase(null, ExpectedException = typeof(ArgumentNullException),
Description = "Calling with null, expecting exception")]
[TestCase("", ExpectedException = typeof(ArgumentException),
Description = "Calling with an empty string, expecting exception")]
public string TestSubString(string value)
{
return MethodUnderTest(value);
}
Is it also a recommended usage - without an explicit assert, just checking on the return value? Or should I stick to the normal way or asserting the value inside the method?