All posts tagged 'TDD'

.NET Musings

Wandering thoughts of a developer, architect, speaker, and trainer

NAVIGATION - SEARCH

Test Driven Productivity Plugin for ReSharper

I admit it.  I am a TDD disciple.  ReSharper (R# in the twitterverse) makes it so much easier.  The one beef that I have is when I am coding up Interfaces and Classes in my tests, there isn't any easy way to move my class and interface to the correct project.

If I start with this code (and neither ISomething or Something exist):

  1: public ISomething GetSomething()
  2: {
  3:     return new Something();

  4: }

I want to very quickly get to this:

  1: public interface ISomething 
  2: {
  3: }
  4: 
  5: public class Something : ISomething
  6: {
  7: }
  8: 

R# will do this very well (including adding the ISomething implementation to the Something class based on analysis of the return type from the GetSomething method). However, these classes are in the same file as my tests. So, again I "alt-enter", and I get a Bulb Item to move this class to another file to match the Type Name. Now, I have two separate files, one for each item (the class and the interface), and now...I must grab the mouse.


There is no slick way to move a file from one assembly to another.  Cut/Paste, Drag/Drop, whatever.  I'm not saying you can't do it, I'm saying it causes too much friction.


Eric Hexter wrote a very nice plugin to help the cause.  It can be found here: ReSharper TDD Productivity Plugin.  I just submitted a patch to Eric to better handle interfaces (the original only handled classes).  The other issue is that it doesn't automatically add the interface implementation, but to me that's nothing, since fixing that is only an "alt-enter" away.


Nice job, Eric!


Happy Coding!

Managed Windows Shared Hosting by OrcsWeb