ReSharper Tip of the Day: Move to the Other Part

Posted on July 4, 2008 by Mark.
Categories: ReSharper Tip of the Day.

Here is another cool one….at least to me. In my test classes I’ve been trying to fake out my dependencies instead of mock them…just for a change and most of the time I don’t really want to assert how the class used the dependency, just that it gives me the correct result.

I create nested private classes using ReSharper. It puts it at the bottom of my current class which is fine. However, all that is noise to me for the most part, so I moved them to a partial class. I have MyClassTests and MyClassFakes, which actually has a MyClassTests partial class that holds…you guessed it, all the fakes….Anyway, here is how ReSharper will move my classes around. It’ll move whatever, is selected. In this case I’m moving my field bar, but in real life I move my nested class.

With my cursor on bar, I use the trusty Alt + Enter. And tell it to move it.

clip_image002

It moves it down to the other part.

clip_image004

More than one partial class? No problem.

clip_image006

no comments yet.

Leave a comment

Names and email addresses are required (email addresses aren't displayed), url's are optional.

Comments may contain the following xhtml tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>