In Visual Studio you can press SHIFT+ALT+C to create new class file. I am looking for similar shortcut for new interface file and new "basic unit test" file. I have Telerik JustCode so please do not suggest simillar product. But if a small extension exists for example, it would be nice to know. BTW I am using Visual Studio 2010 (C#).
There are no built-in solutions for this, but you can easily record macros (In the Tools menu):
You can rename them in the Macro Explorer (Alt+F8)
You can then assign shortcuts to those macros in Tools → Options → Keyboard.
EDIT This doesn't work for adding a new Basic Unit Test. You'll only get to the New Test selection dialog, even with this method.
Rather than using a macro, I would advice you to look into the Code Snippet Manager. It enables you to set up a template of text with "holes" in it. And assign the template to a "key" - a short text (which can be autocompleted). When the key is typed the template replaces the key and the holes can easily be filled out. Further, you can add macro-like functionality to it, to automatically get the current filename or class or date pre-filled.
Visual studio actually is shipped with C# snippets for "Test class" and "Test method".
See also http://msdn.microsoft.com/en-us/library/ms165393(v=vs.100).aspx
Finally, the code snippet support in Resharper (http://www.jetbrains.com/resharper/) is much better than the one in visual studio. Definitely worth checking out. A real productivity boost!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With