|
CR_CreateTestMethod
Provides an number of small utilities useful for Test Driven Development
Introduction¶There are a number of things introduced by this plugin which are intended to make Test Drivent Development easier. These include:
Please note that there is a very big possibility that some of these functions will only work with NUnit based tests. MbUnit is similar, so that may work as well. I would not count on MSTest or xUnit.Net working. Installation¶Installation instructions can be found on the InstallInstructions page. Setup¶Bind the "Create Test" command to a key. I chose to bind to 'CTRL-ALT-T'. When creating the shortcut it is also advisable to use the context providers to specify that the shortcut is available "Inside Test Class" but not "Inside Test Method" (You can find both of these contexts under Editor/Code) Usage¶
So if you have // Can create a new class to do the thing with the stuff ... in your test Then activation will cause the comment to be converted to the following test method stub [Test]
public void Can_create_a_new_class_to_do_the_thing_with_the_stuff()
{
Assert.Fail("Not Implemented");
}
So if you have [TestFixture]
public class MyTestClass
{
private MyClass _testingClass;
[SetUp]
public void SetUp()
{
}
[Test]
public void TestSomething()
{
_testingClass = new MyClass();
}
}...with the cursor on the first line in TestSomething Invoking the "Move To Setup" provider produces the following [TestFixture]
public class MyTestClass
{
private MyClass _testingClass;
[SetUp]
public void SetUp()
{
_testingClass = new MyClass();
}
[Test]
public void TestSomething()
{
}
}
Why did I build this¶I do TDD daily, so this is the beginning of an effort to ease some of the pain points I encounter when working TDD. As with most things, these are all things that I personally thought would be useful. Feel free to suggest additional functionality if there is something you would like that is missing from this group of utilities. Credits¶Original Author: Casey Kramer |


