Skip to content

Instantly share code, notes, and snippets.

@bvli
Created February 13, 2018 09:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bvli/8ab02f5e48d0e22f3c101f16591a3251 to your computer and use it in GitHub Desktop.
Save bvli/8ab02f5e48d0e22f3c101f16591a3251 to your computer and use it in GitHub Desktop.
Fact snippets
<?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>A Fact</Title>
<Shortcut>afact</Shortcut>
<Description>Code snippet for an async xUnit fact</Description>
<Author>Bjarke Lindberg</Author>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>System.Threading.Tasks</Namespace>
<Namespace>Xunit</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>name</ID>
<ToolTip>Replace with the name of the xUnit fact</ToolTip>
<Default>MyFact</Default>
</Literal>
<Literal Editable="false">
<ID>Fact</ID>
<Function>SimpleTypeName(global::Xunit.Fact)</Function>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[[$Fact$]
public async Task $name$()
{
$end$
}]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
<?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>Fact</Title>
<Shortcut>fact</Shortcut>
<Description>Code snippet for a xUnit fact</Description>
<Author>Bjarke Lindberg</Author>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>Xunit</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>name</ID>
<ToolTip>Replace with the name of the xUnit fact</ToolTip>
<Default>MyFact</Default>
</Literal>
<Literal Editable="false">
<ID>Fact</ID>
<Function>SimpleTypeName(global::Xunit.Fact)</Function>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[[$Fact$]
public void $name$()
{
$end$
}]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
@bvli
Copy link
Author

bvli commented Feb 13, 2018

Import in visual studio using the "Tools->Code Snippets Manager" ctrl-k, ctrl-b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment