Skip to content

Instantly share code, notes, and snippets.

@Pvlerick
Created October 14, 2015 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pvlerick/475d6e0f83def350a1c2 to your computer and use it in GitHub Desktop.
Save Pvlerick/475d6e0f83def350a1c2 to your computer and use it in GitHub Desktop.
Visual Studio Snippets
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>xUnit Fact</Title>
<Author>Philippe Vlérick</Author>
<Description>xUnit Unit Test - Fact.</Description>
<Shortcut>fact</Shortcut>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>Xunit</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>testname</ID>
<ToolTip>Test name.</ToolTip>
<Default>UnitTest</Default>
</Literal>
</Declarations>
<Code Language="CSharp" Kind="method decl">
<![CDATA[
[Fact]
public void $testname$()
{
// Fixture setup
$end$
// Exercise system
// Verify outcome
// Teardown
}
]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>xUnit Fact to be skipped</Title>
<Author>Philippe Vlérick</Author>
<Description>xUnit Unit Test - Fact to be skipped.</Description>
<Shortcut>factskip</Shortcut>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>Xunit</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>whyskip</ID>
<ToolTip>Why this test should be skipped.</ToolTip>
<Default>Not implemented yet</Default>
</Literal>
<Literal>
<ID>testname</ID>
<ToolTip>Test name.</ToolTip>
<Default>UnitTest</Default>
</Literal>
</Declarations>
<Code Language="CSharp" Kind="method decl">
<![CDATA[
[Fact(Skip = "$whyskip$")]
public void $testname$()
{
// Fixture setup
// Exercise system
// Verify outcome
// Teardown
}
$end$
]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>xUnit Theory</Title>
<Author>Philippe Vlérick</Author>
<Description>xUnit Unit Theory</Description>
<Shortcut>theory</Shortcut>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>Xunit</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>testname</ID>
<ToolTip>Test name.</ToolTip>
<Default>UnitTest</Default>
</Literal>
</Declarations>
<Code Language="CSharp" Kind="method decl">
<![CDATA[
[Theory]
[InlineData($end$)]
public void $testname$()
{
// Fixture setup
// Exercise system
// Verify outcome
// Teardown
}
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment