Skip to content

Instantly share code, notes, and snippets.

@aligneddev
Last active June 30, 2020 17:32
Show Gist options
  • Save aligneddev/d5ee99a92ddfa239ecff877ecda1f423 to your computer and use it in GitHub Desktop.
Save aligneddev/d5ee99a92ddfa239ecff877ecda1f423 to your computer and use it in GitHub Desktop.
testma to get a test method that is async Task (built in testm is public void)
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>Test Method Async</Title>
<Shortcut>testma</Shortcut>
<Description>Code snippet for a test method</Description>
<Author>Kevin Logan copied from testm by Microsoft Corporation</Author>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>Microsoft.VisualStudio.TestTools.UnitTesting</Namespace>
<Namespace>System.Threading.Task</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>name</ID>
<ToolTip>Replace with the name of the test method</ToolTip>
<Default>MyTestMethod</Default>
</Literal>
<Literal Editable="false">
<ID>TestMethod</ID>
<Function>SimpleTypeName(global::Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod)</Function>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[[$TestMethod$]
public async Task $name$()
{
$end$
}]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment