Snippet for creating testmethod in C#

Posted by Marcus Hammarberg on February 8, 2009

Here is a short snippet that saves me a lot of time. It simply creates a test method with the correct attributes and stuff. Simply but useful – and now you don’t have to write it.

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="">
<CodeSnippet Format="1.0.0">
<Description>Code snippet for creating a testmethod</Description>
<Author>Marcusoft (</Author>
<ToolTip>The name of the test</ToolTip>
<Code Language="csharp">
<![CDATA[<TestMethod()> _
public void should_$methodName$()
// Arrange

// Act

// Assert
Assert.Fail("Implement test");

If you liked this post ... here's more for you:

Published by Marcus Hammarberg on Last updated