Unit testing inside the code editor and the Solution Explorer
Let’s compare the benefit of the CodeRush Unit Testing Service against the native Visual Studio unit testing support as an example. The first things that may catch your attention are test icons near test methods, test fixtures and namespaces containing test cases:
You can see different test icons depending on the status of a test:
|Test(s) has not run yet|
|Test(s) has run and passed|
|Test(s) has run and passed, however there have been changes to the code since the last run|
|Test(s) has run and failed|
|Test(s) has run and failed, however there have been changes to the code since the last run|
|Test(s) has been ignored|
By clicking on this icon, a context menu appears giving you several options:
This lets you run or debug a single test in all supported frameworks, including Silverlight. Note that Visual Studio’s built-in test runner can’t do this.
Test fixtures and namespaces containing unit tests have icons summarizing the run results of their contents. For example, if at least one test has failed, the namespace and the test fixture will both have a red “X” icon, indicating they contain failed test cases.
If you hover the mouse over one of the test icons, you can see the status of the test in a summary hint:
The failed state of a test will show additional testing results such as message, expected results and a call stack:
Instead of seeing results in the Visual Studio’s Test Results window, you see them straight in the code. Such visualization provides a better overview of a test state, and you can apply changes to a test immediately if required.
Tests can also be run or debug test cases from the code editor context menu:
And from the Solution Explorer:
The Visual Studio Output window will have all details about test runs performed:
The summary of all test cases inside entire solution can be seen in the special Unit Test Runner window:
Don’t forget that you can use keyboard shortcuts without interacting with the code editor.—– Products: CodeRush Pro Versions: 12.1 and up VS IDEs: any Updated: Oct/29/2012 ID: C115