Analyzing Test Execution Result and Output

  • 2 minutes to read

After test execution is finished, CodeRush updates the test status within the code editor and in the Test Runner window. A test can have one of the following statuses:

Status

Icon

Description

CRR_IconPending

Test is ready to run.

CRR_IconPending

Test is waiting to run.

CRR_IconExplicit

Explicit test (is not executed by the Run All button).

CRR_IconPassed

Test has passed.

CRR_IconFailed

Test has failed.

CRR_IconIgnored

Test was ignored.

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

CRR_Testing_Results

To obtain detailed information on a failed test, use one of the following ways:

  • Select a failed test and open the Details tab in the Test Runner window.

    CRR_Testing_FailedCode

  • Hover the mouse pointer over the failed test icon in the code editor. You can use the context menu to select all text and copy it. CRR_Testing_FailedCode

The Unit Test Runner also displays the output information in different tabs of the Test Runner window.

Test_Output

The table below shows what methods are associated with each tab. Once a method from the list below is executed, the text passed to the method as an argument appears in the corresponding tab.

Tab Methods
Console output Console.Write, Console.WriteLine
Console errors Console.Error.Write, Console.Error.WriteLine
Debug output Debug.Write, Debug.WriteLine

Grouping and Filtering

The Test Runner window allows you to group tests by:

  • Project
  • Namespace
  • Category
  • File Path
  • Flat List

CRR_TestRunner_Grouping

To see Not Run, Passed, Failed, Ignored or Explicit tests, toggle the corresponding toolbar in the Test Runner window.

CRR_TestRunner_Grouping

NOTE

The Run All command takes filtering into account. This command runs all tests shown in the tests tree when the Test Runner applied filtering.

If you are looking for a particular test, enter a part of the test method name in the Search field.

CRR_TestRunner_Grouping

Export Test Results Data

Test Runner can export test execution results to XML.

CRR_TestRunner_Grouping

The test results data contains the following info:

  • Test name
  • Namespace
  • State
  • Execution duration (if available).
  • Failure details (if the test failed).

If you want to include test's XML documentation comments in the report:

  • Open the Unit Testing | Test Runner options page.
  • Enable the "Include XML documentation comments in export" option.

CRR_TestRunner_Grouping