Digging around in Tools > Options today to find the answer to an inquiry I received, I found some stuff I didn’t know existed. If you work with Visual Studio Test Projects, you will want to know about these options. The Test Tools options are found in Tools > Options > Test Tools.
Test Execution Options
The original question I received was from someone asking how to reduce the number of test results that Visual Studio kept around after test runs. The answer lies in the Test Execution options under Test Result Management. There is an option there labeled “Limit number of old Test Results to.” By default, this value is set to 25. While 25 may be an ideal setting if you are running a multitude of test runs and want to compare results, for most of us this is overkill. Personally I set it to three, and that tells Visual Studio to clean up results older than three runs.
Also take note of the checkbox below it labeled “Double-clicking a Failed or Inconclusive unit test result displays the point of failure in the test.” When you double-click on a failed or inconclusive unit test result, you will no longer be taken to a test result report. Rather, you will be taken to the line of code that failed in the test.
Test Project Options
I have always been frustrated when test projects were created with the “About Test Projects” introduction file and the Manual Test. The next step after creation for me was always to delete these items. In digging around today, I discovered that what files are created with test projects is configurable. Under the Test Project node, you will find a two side-by-side list boxes at the bottom of the settings pane. The left side allows you to select a language-specific test project, and the right side contains checkboxes allowing you to specify which files are included by default.
Conclusion
I’m sure you will find these tips as useful as I have, I know they’ll be making their way into my Visual Studio Tips and Tricks talk.