O'Reilly logo

Microsoft Visual Studio 2015 Unleashed, Third Edition by Mike Snell, Lars Powers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Data-Driven Unit Tests

Let’s build on our knowledge of both basic unit testing concepts and the unit testing framework attribute classes and examine how to create a unit test that feeds off of a data source.

Looking back at Listing 8.1, you recall we had to manually define a few invoice objects in the “arrange” section of the test. This works out fine for the limited data we are dealing with here but would quickly become unmanageable if we wanted or needed a more expansive data set. In other words, instead of just testing with a scenario of adding two invoice lines, what if we wanted to add hundreds? And what if we wanted to dynamically populate those line items instead of hard-coding them in the test method? In these cases, you want ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required