Here is the BDS Live Template I wrote to create an NUnit test method shell for a C# class.


<?xml version="1.0" encoding="utf-8" ?>
<codetemplate xmlns="http://schemas.borland.com/Delphi/2005/codetemplates"
version="1.0.0">
<template name="test" invoke="manual">
<point name="name">
<hint>
Method name
</hint>
<text>
MyUnitTest
</text>
</point>
<description>
Unit test method
</description>
<author>
Kirby Turner - White Peak Software Inc
</author>
<code language="CSharp"><![CDATA[[Test]
public void $name$()
{
$*$Assert.Fail("Not implemented.");$end$
}]]>
</code>
</template>
</codetemplate>


The template will generate the following C# code:


[Test]
public void MyUnitTest()
{
Assert.Fail("Not implemented.");
}

posted by Kirby | 29-Jul-2006 9:19 AM | comments (0)

Add Your Comment

Comment:
(No HTML)

Name:
E-mail/Web site:
Your e-mail/web site will not be published on this site. It is optional and will only be used by me should I need to contact you directly.
 
By checking this option, this site will remember your name and e-mail/web site on future visits. Uncheck this option to have the site not remember who you are on future visits.
 
Enter the code shown above:
Copyright © 1999-2008 Kirby Turner.
Site software written by White Peak Software Inc, a provider of custom software and software development coaching.