Back in 2009 I published ReSharper Live Template For Creating Unit Test Stub. A lot of things have changed since 2009, including my templates. Since I am doing another series of presentations on Test Driven Development I thought I should get these out because people always ask for them.
As stated in my original post these templates are a way for you to create unit test names that help in describing the true intentions of the test and also to provide a common unit test format that will make reading and comprehending your unit tests easier on everyone. And of course as lazy developers any redundancies should be automated!
The first template is for a unit test that does not have specific input criteria.
The second template is for a unit test that has specific input criteria.
You can take the two templates and create new Live Templates and map to whatever key stroke combination you wish. I use ‘tt’ and ‘tw’.
Note: I have been using these Live Templates since ReSharper 3 and I am currently using them in the latest build of ReSharper 6 without any issues so you should be good to go.
As always if you feel these can be improved on or have other Live Templates you want to share let me know in the comments below.
Remember Me
a@href@title, strike
Keith Burnell is a Microsoft web MVP and Senior Software Engineer with Skyline Technologies and president of the Fox Valley .Net User Group. Keith has been developing software for over 10 years specializing in large scale ASP.NET and ASP.NET MVC web site development and architecture (more...)
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.