[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Collapse]CodeRush
  System Requirements
  Improve Performance
 [Expand]Features by Language
 [Expand]Getting Started
 [Expand]How To
 [Expand]Coding Assistance
 [Expand]Navigation and Search Tools
 [Expand]Static Code Analysis
 [Expand]Visualization Tools
 [Expand]Code Style Assistance
  Building Assistance
  Debugging Assistance
 [Expand]Refactoring Assistance
 [Collapse]Unit Testing Assistance
   Testing Framework Configuration
   Running and Debugging Tests
   Test Execution Output
   Working with Test Sessions
   Code Coverage Calculation
   JavaScript Test Runner
   Unit Test Builder
 [Expand]Decompiling Tools
 [Expand]Configuration Options
 [Expand]Extensibility
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Running and Debugging Tests

The Unit Test Runner searches for unit tests (created using one of the supported frameworks) in the solution. Once the tests have been parsed, they are placed to the Test Runner window. You can filter the list of tests by entering a part of the test method name in the Search field. The Grouping menu allows you to choose the way the tests are grouped.

Note

You can run MS Test unit tests using Test Runner in Visual Studio 2019 RC

To execute the discovered tests, use one of the following approaches.

  • From the Visual Studio Menu bar.

    Use the CodeRush | Test menu to run currently selected test(s) or all tests in the solution.

  • From the CodeRush Visualize toolbar.

    If the CodeRush Visualize toolbar is active, use its commands to run tests and debug them.

  • From the Unit Test Runner window.

    Open the Unit Test Runner window using the CodeRush | Windows | Test Runner menu item. This window displays all tests in the solution. You can group them, search for certain tests, filter tests by status, run tests and analyze their results.

    Note

    Test filtering affects the behavior of the Run All command. If you click Run All in the Unit Test Runner window, the filtered out tests will not be executed.

  • From the Code Editor.

    If a test is parsed and ready to run, the Test and TestFixture attributes are marked with the test-tube icon to the left. Click this icon to open the drop-down test runner menu.

    You can also execute a single test case of a parameterized test. Click a test icon and choose the desired option from the Run test, Debug test, or Run test with coverage submenu.

    You can also execute a test for a particular descendant of the current class in a similar manner.

  • From the Solution Explorer.

    You can run all tests in a document using its context menu.

After test execution is finished, the test status is instantly updated in the Test Runner window. A test can have one of the following statuses.

Status

Icon

Description

Test has not been executed

Explicit test (is not executed

by the Run All button)

Test has passed

Test has failed

Test was ignored

You can right-click a test to navigate to its code.

To obtain detailed information on a failed test, select it and open the Details tab, or hover the mouse pointer over the appropriate icon in the code.

The Unit Test Runner enables you to analyze code coverage. Refer to the Code Coverage Calculation article to learn more about code coverage calculation abilities.

Is this topic helpful?​​​​​​​