Much like my previous post about what I use for testing in Silverlight, I was recently asked on Twitter for my ReSharper NUnit templates. I am posting them here if anyone finds them useful.
Basically, I write a LOT of tests every day. These templates allow me to write tests faster.
New Test File Template
This file template adds a new “Test” target when you say tell Visual Studio to create a new file from template. It populates your file with the correct namespaces and decorations to get you started.
These are shortcuts that create new tests, setups, teardowns or assertions. You just type the shortcut, hit tab, and the method or lines are created for you with your mouse cursor in the next place to type. The shortcuts are:
- test – Create a new [Test] method
- setup – Create a [SetUp] method
- teardown – Create a new [TearDown] method
- ise – Assert that condition is equal to value
- ist – Assert that condition is true
- isf – Assert that condition is false
- isn – Assert that condition is null
- isnn – Assert that condition is not null