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

The TestContext Class

The unit test framework contains a class that is used to store information pertaining to executing tests. This class is called TestContext. You use the properties of this class to get information about your running tests, including the path to the test directory, a URL to the executing test (in the case of ASP.NET unit tests), and data-binding information such as the data connection or the current row of data for the executing test class. There are also a couple useful methods of this class for things like writing trace messages. The test context information is stored inside properties of this class. The key properties and methods are defined inside Table 8.1.

TABLE 8.1 TestContext Key Properties and Methods

TestContext ...

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