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 Ordered Tests

Visual Studio enables you to group unit tests, set their sequence of execution, and treat the results as if a single test was run. This can be useful if you need to write unit tests that are dependent on one another. For example, you might insert a record in one test and rely on that record being there in a later test. Of course, this goes against a good practice for unit testing; each test should be able to execute independently. Thankfully, you can create an ordered test that groups the individual unit tests into a new, self-contained test.

You add an ordered test to your test project by right-clicking the unit test project and selecting Add, Ordered Test. You can also select the Ordered Test template from the Add New ...

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