Test Runner
- 4 minutes to read
You can configure the main Unit Test Runner settings on the Unit Testing | Test Runner options page. See Configuration Options topic for more information on how to access this options page.
This page contains the following options:
Enabled
This option specifies whether CodeRush unit testing services are available in Visual Studio. If you turn off this option, CodeRush disables the Test Runner Window and does not draw testing icons in the code editor. So, you cannot run test cases in Visual Studio.
Send Test Results to Output Window
Specifies whether to send the Unit Testing Service messages to the Visual Studio Output window.
The screenshot below shows the Output window's messages.
Enable the "Suppress ignored test results" option if you do not want CodeRush to include modules with ignored test results in the output window.
Show Test Filtering Conditions in the Output
Specifies whether to show filtering conditions applied to unit tests in the Visual Studio Output window.
Summarize Test Runner Results on Visual Studio's Status Bar
Enable this option to see the test execution summary in Visual Studio's status bar.
Clear All Test Results when Running an individual Test
Specifies whether the Unit Test Runner clears the results of all executed tests before it runs a single test case.
Show Test Run Icons in the Editor
This option specifies whether CodeRush draws clickable icons near testing methods and test fixtures in the code editor.
Highlight the Error Line for a Failed Test
Specifies whether CodeRush highlights the code line for a failed test.
To customize the background color and background opacity of the highlighted line, perform the following actions:
Open the Test Runner options page.
Expand the Advanced tab.
Configure "Error Background Color" and "Error Background Opacity" options.
Collect Tests from Assemblies When Projects are Built
When the "Collect tests from assemblies when projects build" option is enabled, the Unit Test Runner discovers tests from source code and assemblies when you open a solution. The Test Runner also checks each test from assemblies on relevance based on test file and pdb file data.
Test discovery from assemblies is aborted during code building or test runs. If projects are built successfully, the Unit Test Runner collects tests from assemblies for these projects.
Execute in x64 Mode if Active Configuration is AnyCPU
The Unit Test Runner can run tests in x64 mode. Enable this option if you use an x64 operating system and an AnyCPU configuration.
Do not Build Required Projects Before Testing
This option does not allow a project and its dependent projects to be rebuilt before test execution. This can increase the startup time of the unit tests execution. If you modify the source code before tests execution, it can also cause incorrect test results.
Build Unit Test Runner Items into Visual Studio Context Menu
Enable this option to allow CodeRush to add Unit Test Runner and Code Coverage items to the Visual Studio context menu.
Include XML Documentation Comments in Export
When this option is enabled, CodeRush adds XML documentation comments to the test results report.
The following screenshot shows the TestResultsReport.xml file with an XML documentation comment:
Max Assemblies to Test in Parallel
Specifies the maximum number of threads used for unit testing from 1 to 10. The default value is 2.
Exclude Tests in Categories
This option lets you ignore tests by category.
Excluded tests are marked as Ignored in the Test Runner window.
Configure Path to Framework
You can configure the paths to libraries for each supported unit testing framework (for example, NUnit, xUnit, etc.) in the "supported frameworks" table:
Choose a framework to see what libraries are used for running tests.
Click the ellipsis button to change the library reference.