New Features in ReSharper 6 Unit Test Runner
August 23rd, 2011 by Hadi HaririPrevious posts introducing ReSharper 6:
- ReSharper 6 EAP is Open; Details on JavaScript Support
- CSS Support in ReSharper 6
- ReSharper 6 Bundles Decompiler, Free Standalone Tool to Follow
- ReSharper 6 Enhances Suggestions with Explanations
- ReSharper 6 Introduces support for JavaScript Unit Testing with QUnit
- ReSharper 6 Enhances Razor Support
- File Header Macros in ReSharper 6
ReSharper 6 includes a series of new features and improvements in the test runner, as outlined below.
NUnit TestCase
We now fully support NUnit’s TestCase, TestCaseSource, Values, Ranges and other attributes. Given the following tests:
![]()
ReSharper outputs the results as individual tests, appropriately grouped.
![]()
This allows us to now run and view tests individually.
![]()
As expected, dotCover and dotTrace also provide support for this.
Support for Coded UI Tests with MSTest
Coded UI tests (when appropriate) are also supported now with the ReSharper test runner
![]()
Default Keyboard Bindings and Test Re-Runs
Out of the box ReSharper now ships with pre-defined shortcut keys for running, debugging, re-running tests, among other things. This eases the pain of having to map keys on new installations (as of ReSharper 6, you no longer loose your key bindings during upgrades!). By default, the key-bindings for the schemes are:
| Operation | Visual Studio | IntelliJ IDEA |
| Run Unit Tests. Context Sensitive | Ctrl+U, R | Ctrl+T, R |
| Debug Unit Tests. Context Sensitive | Ctrl+U, D | Ctrl+T, D |
| Run ALL Unit Tests | Ctrl+U, L | Ctrl+T, L |
| Run Current Session | Ctrl+U, Y | Ctrl+T, Y |
| Rerun last test. Context Insensitive |
Ctrl+U, U | Ctrl+T, T |
This last shortcut is a new feature added in 6 which allows us to re-run the last test we just ran. And we can run it from anywhere! This makes TDD for instance very easy as we can write some code, be in the actual code and run the test, without having to switch back to the test or open up the unit text explorer.
Running Tests from File Structure and Find Results Windows
You can now run Tests directly from the File Structure Window
![]()
as well as the Find Results Window
![]()
again, removing some of the friction when it comes to testing.
Categories
Certain Unit Testing frameworks provide test categories. For example, in NUnit there is the [Category] attribute. ReSharper now allows us to ignore specific categories and not run them during a test run. This is accomplished by indicating the category under ReSharper | Options | Unit Testing
![]()
When running unit tests, these appear as ignored.
![]()
This is useful for instance when we want to avoid running certain tests during development sessions.
Categories can also be used to run a specific group of tests by selecting these from the context menus:
![]()
Other improvements
Some other minor improvement or previous features we have blogged about include:
- QUnit Support
- Unit testing Sessions are now persisted between Visual Studio restarts
- Ability to run tests in parallel from different assemblies, decreasing testing time (can be turned off in ReSharper | Options | Unit Testing)
- General performance improvements
- Update Progress indicator on Windows task bar
![]()
As always, we welcome your feedback
Tags: ReSharper, ReSharper 6, unit testing

August 24th, 2011 at 8:48 am
Are you also going to support the DeploymentItem attribute for MSTest. This allows units tests to run consistently between R# and TFS Build
August 24th, 2011 at 1:31 pm
@Robert,
I’m not sure at this point. Could you please log a feature request?
Thanks.
August 24th, 2011 at 2:13 pm
The feature “Rerun last test. Context Insensitive” is nice.
Is there also a feature “ReDEBUG last test. Context Insensitive”?
August 24th, 2011 at 6:26 pm
Robert,
DeploymentItem attribute is already partially supported in 6.0 and full support is ready for the next minor update.
Markus,
if you ran tests under debugger previous time, debug session will be repeated.
September 2nd, 2011 at 10:47 am
There is a bug in the test runner related to NUnit’s parametrized test fixtures.
Do you know when fix will be released?
September 2nd, 2011 at 5:53 pm
@Oleg
What kind of issue are you referring to? this one, one of the wider list, or something that has not been put into our issue tracker at all?
Thanks
September 5th, 2011 at 10:41 am
@Jura
I found this issuein the tracker but looks like people keep filing this bug, so I’m not alone