Does NUnit have data provider?
NUnit includes several attributes for providing data to test methods. Please see the GitHub NUnit documentation for a complete list.
All of the built-in features allow data to be provided programmatically, however NUnit excludes any properties that allow data to be retrieved from a file or other external source.
There are two ways to interact with this:
-
Create a method that reads external data and returns test cases using an existing attribute such as [TestCaseSource].
-
Develop an internal custom attribute that accepts the name of a specific type of source, opens it, reads the data, and generates test cases.