Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Visual Studio 2008 Code Snippet for creating a NUnit test method.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2008/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Unit Test</Title>
<Author>João Angelo</Author>
<Description>Inserts a NUnit test method.</Description>
<Shortcut>ut</Shortcut>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>NUnit.Framework</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>Description</ID>
<Tooltip>Replace with the description of the behaviour under test.</Tooltip>
<Default>...</Default>
</Literal>
<Literal>
<ID>MethodUnderTest</ID>
<Tooltip>Replace with the name of the method under test.</Tooltip>
<Default>MethodUnderTest</Default>
</Literal>
<Literal>
<ID>TestID</ID>
<Tooltip>Replace with the identifier for the current test.</Tooltip>
<Default>001</Default>
</Literal>
</Declarations>
<Code Language="CSharp">
<![CDATA[[Test]
[Description("$Description$")]
public void $MethodUnderTest$_T$TestID$()
{
$end$
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.