Keyboard Shortcuts

[Xai comments] I just started using your tool and I have to say that I love it. Only one thing I'd improve, give us a keyboard shortcut! By that I mean let us know what we should map keyboard shortcuts to. For instance, I want to map a keyboard short cut to running tests on the solution. What command would I map it to? Or can I?

Indeed you can! Infact I even make sure your keyboard shortcuts don't get trampled when you install a new version.  Here is how you would go about assigning a keyboard shortcut to the 'Run Test(s)' command.  This shortcut will work when you have the cursor inside a method, class or namespace.  It will also execute all tests in a project if a project is selected in the solution explorer.  I've chosen Ctrl+Alt+F5 because of the semantic similarity to Ctrl+F5 (Start Without Debugging).

  1. Right click on a tool bar or menu and select 'Customize...'.
  2. On the 'Toolbars' tab click 'Keyboard...'.
  3. Show commands containing 'Client'.
  4. Select 'NUnitAddIn.ManagedAddIn.Connect.Client'.
  5. Press shortcut keys: Ctrl+Alt+F5
  6. Click Assign

I apologize about the slightly odd command naming.  The reason for this is that it's built from NUnitAddIn's ProgId (which is 'NUnitAddIn.ManagedAddIn.Connect') combined with the name of the command.  If the ProgId changes in future, you will have to redo your key mappings.

There are the commands that are most likely to be of interest.  They all start with the 'NUnitAddIn.ManagedAddIn.Connect.' prefix.

  • Client - Build and execute test(s) in a cached external process (this is the default Run Test(s) test runner).
  • Project - Build and execute tests in the current project.
  • Solution - Build and execute tests in the current solution.
  • Restart - Restart the last executed test(s).
  • Debugger - Build and execute test(s) in the debugger.
  • DebugString - Build and execute test(s) showing all OutputDebugStrings (including in spawned app domains and processes).
  • DllLoad - Build and execute test(s) showing all loading Dlls.
  • CreateProcess - Build and execute test(s) showing all spawned process command lines (watch the XmlSerializer spawn two processes per type!).
  • DTE - Build and execute test(s) in the Visual Studio process (the extensibility object is accessible using AppDomain.CurrentDomain.GetData("DTE")).
  • Abort - Abort the current test run.
  • NUnit_GUI - Build and load tests using the NUnit GUI (in an external process).

4 Comments

Comments have been disabled for this content.