Geeks With Blogs
Boy Meets 'Hello World' Blogging the journey from College Grad to .NET Developer

I use Resharper's unit test runner for running my unit tests while coding. I got sick of having to use my mouse to run my tests, but I couldn't figure out a good way to do it using Resharpers available key bindings. When the application is focused on the text editor window, you basically had two options for key bindings:

 

1.) Context Run. I'm not sure exactly what this did in terms of how it determined what tests to run, but it had something to do with looking at what class was open currently. This meant I could not use this to run my unit tests if I was currently in the class that I'm trying to implement. I want to be able to run my tests without having to navigate back to my tests.

2.) Run solution. I don't want to run all the tests in my solution. I'll do that later. I just want to run the tests specific to this class, the ones that I have in my unit test session.

 

The best result I've been able to find is the following:

 

1.) ReSharper.ShowUnitTestSessions. I'll set this to Shift+ALT+N. All this does will switch focus to my unit test window. It won't actually run the test. I set this as only usable in the text editor, because I also use...

2.) ReSharper.UnitTestSession_RunAll. This is also set to SHIFT+ALT+N. This will run all the tests, but it only works if you are already focused on the Unit Test window.

 

So, in the end, I hold SHIFT+ALT and press N twice. I'm sure there might be a better way, but I haven't found it yet.

EDIT (June 7, 2008):

I can't believe I just noticed this now! After running your unit tests, hit escape (I have it mapped to capslock, I do some stuff with VIM so it's second nature), that brings you back to your editor. The funny part was that the first time I didn't even realized that I did it, it just came so naturally.

Posted on Friday, June 6, 2008 3:08 AM | Back to top


Comments on this post: Quick run unit tests.

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © mhildreth | Powered by: GeeksWithBlogs.net