MbUnit Snippets

MbUnit ships with 15 C#\VB and 2 XML code snippets for use with Visual Studio as follows. To install them,

  1. Open the Code Snippets Manager (Tools | Code Snippet Manager or Ctrl+K,B)
    VS Code Snippet Manager screenshot. Click this thumbnail image to show full size image

  2. Choose the language you want to add snippets for from the “Language” dropdown menu at the top of the manager dialog.
  3. Click Add and navigate to the MbUnit installation directory. Open the VSSnippets directory inside that.
  4. Select the folder containing the snippets for your language and click “Select Folder”.
  5. Verify the snippets have been added by expanding the MbUnit*Snippets folder in the manager dialog and selecting a few. Press OK when done.
    MbUnit snippets listed in Code Snippet Manager screenshot. Click this thumbnail image to show full size image

Xml Snippets

There are 2 XML snippets included with MbUnit. To use them, use either Edit | Intellisense | Insert Snippet or Ctrl+K, X.

Note that in both cases, the XML calls custom tasks for MSBuild and nAnt which we’ve developed for ease of use. Have a look at the integrating MSBuild and integrating nAnt pages for more on how to get these custom tasks working.

C# and Visual Basic Snippets

There are 15 code snippets for test writing, both in C# and VB. To use them, simply type the name given below while in a VB or C# source file and press TAB twice.

If you’d like to donate your own snippets to the team or suggest how to improve the current ones, get in touch on the MbUnit-Dev google group.