All docs
V21.1
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Test Runner

  • 4 minutes to read

You can configure the main Unit Test Runner settings on the Unit Testing | Test Runner options page.

Options

For more information on how to access this options page see the following topic: Configuration Options.

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.

Output

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.

Filter

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.

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.

Icons

Highlight the Error Line for a Failed Test

Specifies whether CodeRush highlights the code line for a failed test.

Highlight

To customize the background color and background opacity of the highlighted line, follow the following steps:

1) Open the Test Runner options page.

2) Expand the Advanced tab.

3) Configure the “Error background color” and “Error background opacity” options.

Configure Color

Show White Spaces and Line Breaks in the Test Result

The “Show white spaces and line breaks” option specifies whether the Unit Test Runner displays white spaces and line breaks in the test execution result.

Configure Color

NOTE

This feature is not supported in .NET Core projects.

This option is initially enabled and located on the Advanced tab of the Test Runner options page.

Configure Color

Collect Tests from Assemblies When Opening a Solution and Rebuilding Projects

When this option is enabled, the Unit Test Runner discovers tests from source code and assemblies when you open a solution. The Unit Test Runner 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. The Unit Test Runner rediscovers tests from an assembly if the corresponding project is rebuilt successfully.

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.

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:

Test Report

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.

Exclude Option

Excluded tests are marked as ignored in the Test Runner window.

Mark

Configure Path to Framework

You can configure the paths to libraries for each supported unit testing framework (for example, NUnit and xUnit) in the “supported frameworks” table:

1) Choose a framework to see what libraries are used for running tests.

2) Click the ellipsis button to change the library reference.

Frameworks