# Saturday, August 07, 2004

There's one new cool feature of the VS2005 that has not received much attention, CodeSnippets. With CodeSnippets, you can write code template in minutes that are directly integrated into the intellisense of VS. That's great.... the sad point is that they are totally undocumented :(

CodeSnippets

Here's a small description of CodeSnippets in VS Express and here's a better tutorial but it is in french.

CodeSnippets for MbUnit

MbUnit has now CodeSnippets to create fixture, test methods, etc... all kinds of snippets that you write again and again. To set up the snippets, you need VS2005 and to download the MbUnit Code Snippets from www.dotnetwiki.org (they will be integrated in the next release).

Unzip the file in a directory and go to the menu Tools -> Code Snippets Manager... In the dialog, push Add and choose the directory where you have unzipped the snippets. The dialog window should look as follows. Clicking on each snippet will give you a short description, the shortcut to execute it, etc...

TestFixture snippet

In you need to create a new fixture, the TestFixture snippet is now here to help. Create a new blank C# file and write te. Intellisense window should pop out and now you will see new items: test, testfixture, etc...

 Go to the textfixture item and double "tab" it. The editor will execute the template and expand the item into an empty TestFixture class definition as follows:

 

You can also access the MbUnit expansion fixture by looking in the context menu, Intellisense -> Expand Item... -> MbUnitExpansion

posted on Saturday, August 07, 2004 1:52:00 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [5]
Monday, June 06, 2005 3:40:50 AM (Pacific Daylight Time, UTC-07:00)
VSEditor's WebLog
Monday, June 06, 2005 3:40:51 AM (Pacific Daylight Time, UTC-07:00)
Just found this: <a target="_new" href="http://blogs.msdn.com/vseditor/archive/2004/07/14/183189.aspx">http://blogs.msdn.com/vseditor/archive/2004/07/14/183189.aspx</a>
Jonathan de Halleux
Monday, June 06, 2005 3:40:51 AM (Pacific Daylight Time, UTC-07:00)
More on snippets by James Newkirk
<br><a target="_new" href="http://blogs.msdn.com/jamesnewkirk/archive/2004/06/02/147153.aspx">http://blogs.msdn.com/jamesnewkirk/archive/2004/06/02/147153.aspx</a>
Jonathan de Halleux
Monday, June 06, 2005 3:40:52 AM (Pacific Daylight Time, UTC-07:00)
Snippy, an editor for CodeSnippets
<br>
<br><a target="_new" href="http://blogs.msdn.com/gusperez/articles/93681.aspx">http://blogs.msdn.com/gusperez/articles/93681.aspx</a>
Jonathan de Halleux
Monday, June 06, 2005 3:40:52 AM (Pacific Daylight Time, UTC-07:00)
Dan Fernandez pointed my out this MSDN article:
<br>
<br><a target="_new" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/codesnippets.asp?frame=true">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/codesnippets.asp?frame=true</a>
Jonathan de Halleux
Comments are closed.