Something like NUnit TestCaseSource in Visual Studio Unit Testing

Is there something similar to the NUnit TestCaseSource attribute in Visual Studio unit testing? The closest solution I found is to use a DataSource. But I do not want to store the test case parameters in the data source.

+7
unit-testing visual-studio testing
source share
1 answer

A data source is one of the input options for test input. You can save your test data in many file formats (xml, xls or sql db)

But if you do not want to store your test data, use the TestInitialize () attribute in any method that will be executed before any of your test cases. Save all the test data execution time in xml, xls or sql db using this method, and then using the data source, use it in your test cases.

Here is the msdn link for the VSTS unit test. Hope this helps you.

+2
source share

All Articles