Enabling Code Coverage

Visual Studio enables getting information on the amount of code that was subject to the actual test. This can be accomplished by enabling a feature known as Code coverage. To enable it, follow these steps:

1. Select the Test, Edit Test Settings, Local command. This enables editing the current test configuration;

2. When the Test Settings dialog appears, select Data and Diagnostics; then flag the Code Coverage option in the bottom-right part, as shown in Figure 59.5;

Figure 59.5 Enabling code coverage.

image

3. Click Configure. When the Code Coverage Details dialog appears, select the test assembly, which in this case is TestProject1.dll ...

Get Visual Basic® 2010 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.