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
Fatal error: Uncaught Error: Call to undefined function eregi_replace() in H:\root\home\megazoid-001\www\skorkincom\wp-content\plugins\bbcomments\BBComments.php:41 Stack trace: #0 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-hook.php(289): render_comment() #1 H:\root\home\megazoid-001\www\skorkincom\wp-includes\plugin.php(212): WP_Hook->apply_filters() #2 H:\root\home\megazoid-001\www\skorkincom\wp-includes\comment-template.php(1028): apply_filters() #3 H:\root\home\megazoid-001\www\skorkincom\wp-content\themes\inove\functions.php(1163): comment_text() #4 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-walker-comment.php(179): custom_comments() #5 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-walker.php(144): Walker_Comment->start_el() #6 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-walker-comment.php(139): Walker->display_element() #7 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-walker.php(332): Walker_Comment->display_element() #8 H:\root\home\me in H:\root\home\megazoid-001\www\skorkincom\wp-content\plugins\bbcomments\BBComments.php on line 41