Snippet for creating testmethod in C#

· 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” ?> <Header> TestMethod tm Code snippet for creating a testmethod Marcusoft (www.marcusoft.net) Expansion SurroundsWith </Header> methodName The name of the test methodName <![CDATA[<TestMethod()> _ public void should_$methodName$() { // Arrange // Act // Assert Assert.Fail("Implement test"); }]]>

Twitter, Facebook