Feature Request: Move type should better support Test Driven Design

Hi,

I'm fairly new to Resharper, but I think it is an awesome product. However when watching the the TDD Screencast, I noticed how often Even Hoff performed the following operation:

1. Write a test for a class that doesn't exist, e.g. "User"
2. Chose "Create class 'User'".
3. Change class from "internal" to "public"
4. Chose "Move..."
5. Chose "Another file".
6. Go to Solution Explorer, find the file, and click "Ctrl-X"
7. Find the solution where the file should be located and click "Ctrl-P"
8. Open the file and correct the namespace.

I also remembered how often I have performed the same sequence. Since this is a key operation in TDD when you write tests first, I would like this to be much simpler. E.g.

1. Write a test for a class that doesn't exist, e.g. "User"
2. Chose "Create class 'User' and move to...".
3. Select destination namespace/project and some other options, and click "Finish".

]]>

Keep up the good work :)
<br/><br/>
BB

5 comments
Comment actions Permalink

Hello bb,

Thanks for the suggestion. This is exactly what I thought when I was watching
Even's video. We didn't yet come up with reasonable solution, but we are
thinking about it. While populating your new class with properties and methods
you may wish it to be visible (I wish). So, it should probably be separate
action, which can be invoked on type (or several types) and will move them
to different location, both namespace and project structure. This can also
help when you restructure existing code, not necessary generating new types
from tests.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Thanks for the reply! Glad to hear that you are thinking about it.
<br/><br/>
I agree that this should also be available for existing types.
<br/><br/>
I don't need to see the code when writing the test, since ReSharper makes it so easy to switch between classes :) I would therefore prefer if it was available both as:
<br/><br/>

  • "Create and move" for new types (in addition to the "Create" command)<br/>

  • "Move" for existing types.<br/>

<br/>
Regards,
BB

0
Comment actions Permalink

Following the same route(?), it would be really nice if the current Create
new class quickfix gave you an option to create the class in a new file (but
in the current namespace), instead of adding it to the end of the current
file:

Regards,

Dag


0
Comment actions Permalink

+1 for this.

I like to try and keep each class in its own file (not religious about it,
just prefer it for most cases).

"Dag Christensen" <anonymous@noreply.com> wrote in message
news:ffpv8m$tui$1@is.intellij.net...

Following the same route(?), it would be really nice if the current Create
new class quickfix gave you an option to create the class in a new file
(but in the current namespace), instead of adding it to the end of the
current file:

>

Regards,

>

Dag

>


0
Comment actions Permalink

Hello Paul,

I agree too, I even made it in my Nerpa plugin some time ago, and used a
lot. Currently in ReSharper it is pretty tough task, because we have so many
quick fixes on an unresolved symbol (and even more, if you think C# 3.0).
We are thinking about second level quick fix menu, so that you can use straigthforward
first level items, and if you need something different you could go deeper
and select second level item. I hope we can have it for ReSharper 4.0, but
it depends on VS2008 timeframe and available resources.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


PB> +1 for this.
PB>
PB> I like to try and keep each class in its own file (not religious
PB> about it, just prefer it for most cases).
PB>
PB> "Dag Christensen" <anonymous@noreply.com> wrote in message
PB> news:ffpv8m$tui$1@is.intellij.net...
PB>
>> Following the same route(?), it would be really nice if the current
>> Create new class quickfix gave you an option to create the class in a
>> new file (but in the current namespace), instead of adding it to the
>> end of the current file:
>>
>> Regards,
>>
>> Dag
>>


0

Please sign in to leave a comment.