TestCaseData · nunit/docs Wiki · GitHub
github.com › nunit › docsJul 10, 2020 · NUnit Project Docs. NUnit. Release Notes. Framework; Console and Engine; License; Getting Started. Installation; Upgrading.NET Core and .NET Standard; Samples; Breaking Changes; Writing Tests. Attributes; Assertions. Multiple Asserts; Assumptions; Warnings; Constraints; SetUp and TearDown; TestCaseData; TestFixtureData; TestContext; AssertionHelper; ListMapper; Running Tests. Console Runner
NUnit - TestCaseSource
nunit.org › nunitv2 › docsTestCaseSourceAttribute (NUnit 2.5) TestCaseSourceAttribute is used on a parameterized test method to identify the property, method or field that will provide the required arguments. The attribute has two public constructors. TestCaseSourceAttribute (Type sourceType, string sourceName); TestCaseSourceAttribute (string sourceName); If sourceType is specified, it represents the class that provides the test cases.
nunit 3.0 - Checking exceptions with TestCaseData parameters ...
stackoverflow.com › questions › 57126394Jul 20, 2019 · 1. I'm using NUnit 3 TestCaseData objects to feed test data to tests and Fluent Assertions library to check exceptions thrown. Typically my TestCaseData object contains two parameters param1 and param2 used to create an instance of some object within the test and upon which I then invoke methods that should/should not throw exceptions, like this: var subject = new Subject (param1, param2); subject.Invoking (s => s.Add ()).Should ().NotThrow ();
TestCaseData | NUnit Docs
docs.nunit.org › writing-tests › TestCaseDataThe TestCaseData class provides extended test case information for a parameterized test, although any object deriving from TestCaseParameters may be used. Unlike NUnit 2, you cannot implement ITestCaseData, you must derive from TestCaseParameters. [TestFixture] public class MyTests { [TestCaseSource (typeof (MyDataClass), nameof (MyDataClass.TestCases))] public int DivideTest(int n, int d) { return n / d; } } public class MyDataClass { public static IEnumerable TestCases { get { yield return ...