My Visual Studio Code Snippets

The xUnit .Net codeplex page lists one useful Visual Studio code snippet for creating a Fact.  As you can tell I am fairly fond of code snippets so I created a few more which I use when writing facts. These are one line snippets that I find very convenient when writing my assertions.

Below is a table which shows the shortcut you use to access the snippet and the code the snippet generates

Shortcut Snippet
ae Assert.Equal($expected$,$actual$)
ane Assert.NotEqual($expected$,$actual$)
an Assert.Null($actual$)
ann Assert.NotNull($actual$)
at Assert.True($actual$)
af Assert.False($actual$)

You can download these here: [download id=”13″ format=”3″].   Enjoy!

  • I can’t believe it was so difficult to find someone that had already done these! I wonder if you could get them added in the xunit contrib project?

  • Bring traffic to your blog instantly!