CodeRush

Unit Test Runner

Unit Test Runner is a powerful unit testing tool. It executes your unit tests, navigates through tests, and facilitates processing test results. Unit Test Runner supports the MbUnit, MSpec, VS Test, NUnit, SlUnitTesting, and xUnit frameworks.

If your solution contains tests and the appropriate framework is referenced, then Unit Test Runner recognizes tests, marks them with an icon to the left of each test attribute, and creates a tests tree in the Unit Test Runner Tool Window that enables you to easily navigate through tests.

Since the tests are recognized, you can easily execute them. Use one of the following execution methods.

  • From the Unit Test Runner tool window

    Choose an item from the Tests tree and click the Run button, or simply double click the item. This will execute the item if it is a test, or it will execute all child tests if the item is a solution, a namespace, or a class. To execute all tests, click Run All. Click the Debug button to run the test in a debug mode. To repeat the last test execution, click Repeat last test(s).

    Test execution from the Unit Test Runner tool window - CodeRush by DevExpress

  • From the Code Editor

    To execute a certain test, click its icon in the code and choose Run Test (or Debug to run in the debug mode) from the context menu. You can also right click anywhere within a test or a class, and choose Run test(s) from the context menu to execute the test or all tests in the class.

    Test execution from the code editor - CodeRush by DevExpress
  • From the Solution Explorer

    Right-click a solution explorer item containing tests and choose Run Test(s) from the context menu. It will execute all tests contained in the item.

    Test execution from the Solution Explorer - CodeRush by DevExpress

  • Programmatically
    Use the CodeRush.UnitTests.Execute() method located in the DevExpress.CodeRush.Core namespace. CodeRush.UnitTests includes several overloads of the Execute method, which enable you to run separate tests or test collections. To execute tests in the debug mode, use the CodeRush.UnitTests.Debug() method and its overloads.

The status of all tests (passed, failed, ignored, etc.) is indicated within the code editor with an icon to the left of the test attribute and also within the Unit Test Runner tool window. The tool window also includes information on test execution duration at the right part of the tests tree.

Test execution results - CodeRush by DevExpress

To get more information on a failed test, simply place the mouse pointer over the appropriate marker in the source code. You can right-click a test listed in the Unit Test Runner and select "Go to Test" to navigate to that test.

Detailed test execution results are displayed in Visual Studio's Output window. The code line that caused test failure is highlighted.

Test execution details - CodeRush by DevExpress

To simplify the processing of test results, the Unit Test Runner tool window provides grouping tests and the easy-to-use test filtering capability.

You can group tests by project, category, namespace or show all tests in a single list. Choose the appropriate item from the Grouping menu.

Test grouping - CodeRush by DevExpress

To show only failed or ignored tests, click the corresponding button on the window toolbar.

Test filtering - CodeRush by DevExpress

You can also filter the tests listed by entering a portion of the test method name.

Test text filtering - CodeRush by DevExpress

LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2014 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners