O'Reilly logo

Microsoft® Visual Studio® 2010 Unleashed by Lars Powers, Mike Snell

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 Test Attribute Classes

The unit tests you write are run by Visual Studio using the unit test execution host. This host has to examine your code and find the unit tests within in it and run them accordingly. To do so, it relies on attributes. Recall that an attribute is used to provide metadata about your code. Other code (such as the unit test host) can use reflection to determine various bits of information about your code.

As you’ve seen in the brief samples thus far, you signify unit tests by decorating your code with the attribute classes defined inside the unit namespace. For example, a test class has the TestClass attribute; a test method is indicated using the TestMethod attribute. Table 9.2 presents a list of the most common attribute ...

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