Search code examples
.netunit-testingdata-driven-tests

Data Drive Unit Test - Programmatically Skipping Rows


Is there a way to programmatically skip rows in a data drive unit test? I want to run all rows on our build server, but only one row when debugging.


Solution

  • What you could do is generate a test that only performs its action on one row. Then create another test that is a single liner, calling the single row test. Make this your actual data-driven test.

    Include the data-driven (skeleton) tests in your nightly build process and use the single row one during debugging.