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).
- 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.
- 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.
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.
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.
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.
To show only failed or ignored tests, click the corresponding button on the window toolbar.
You can also filter the tests listed by entering a portion of the test method name.