Last active
July 5, 2016 19:24
-
-
Save kzu/2bb3316d59a3aa7a2216 to your computer and use it in GitHub Desktop.
Code snippet for creating BDD-style xUnit tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<!-- Download to %userprofile%\Documents\Visual Studio [2010|2012|2013|vNext]\Code Snippets\Visual C#\My Code Snippets --> | |
<!-- | |
Template for xunit test methods | |
Press fact[tab][tab] to get it. | |
--> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>XUnit test</Title> | |
<Shortcut>fact</Shortcut> | |
<Description>Create XUnit test method</Description> | |
<Author>Daniel Cazzulino</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
</Header> | |
<Snippet> | |
<Imports> | |
<Import> | |
<Namespace>Xunit</Namespace> | |
</Import> | |
</Imports> | |
<Declarations> | |
<Literal> | |
<ID>action</ID> | |
<ToolTip>Action performed on the given context</ToolTip> | |
<Default>action</Default> | |
</Literal> | |
<Literal> | |
<ID>assert</ID> | |
<ToolTip>The consequence of the action</ToolTip> | |
<Default>assert</Default> | |
</Literal> | |
</Declarations> | |
<Code Language="csharp"> | |
<![CDATA[[Fact] | |
public void when_$action$_then_$assert$() | |
{ | |
$end$ | |
}]]> | |
</Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment