Enabling Code Coverage

Visual Studio enables you to get information on the amount of code that was subject to the actual test. This can be accomplished by using a feature known as Code Coverage. To see code coverage results, you select Test, Analyze Code Coverage, All Tests for all unit tests or Selected Test for unit test you selected in Test Explorer. The Code Coverage Results window shows information on collected results. Figure 53.4 shows such results.

Image

FIGURE 53.4 Examining Code Coverage Results.

You can expand the results to get information on the code coverage percentage for single members. For example, both test methods have a 100% ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.