NUnit - TestCase
nunit.org › nunitv2 › docsNUnit - TestCase NUnit Version 2 Documentation Archive TestCaseAttribute (NUnit 2.5) TestCaseAttribute serves the dual purpose of marking a method with parameters as a test method and providing inline data to be used when invoking that method. Here is an example of a test being run three times, with three different sets of data:
Testing for exceptions with [TestCase] attribute in NUnit 3?
stackoverflow.com › questions › 35061336Jan 28, 2016 · I want to test this method using NUnit 3.0 test cases, so maybe I have: [TestCase (-10, 2, -5)] [TestCase (-1, 2, -0.5)] public void TestDivide (double a, double b, double result) { Assert.That (_uut.Divide (a, b), Is.EqualTo (result)); }
TestCase | NUnit Docs
docs.nunit.org › attributes › testcaseBecause arguments to .NET attributes are limited in terms of the Types that may be used, NUnit will make some attempt to convert the supplied values using Convert.ChangeType () before supplying it to the test. TestCaseAttribute may appear one or more times on a test method, which may also carry other attributes providing test data.
TestCaseSource | NUnit Docs
docs.nunit.org › attributes › testcasesourceTestCaseSource | NUnit Docs TestCaseSource TestCaseSourceAttribute is used on a parameterized test method to identify the source from which the required arguments will be provided. The attribute additionally identifies the method as a test method. The data is kept separate from the test itself and may be used by multiple test methods.