Resharper and TDD

When i am working in a unit test, and have a class in my test that does not exist
TestAccountHasAnID(){
Account acct = new Account()
Assert.IsTrue(acct.Id>0)
}

Is there a way i can tell Account class to be generated in a seperate file as soon as i write this much code.

When i create a class, the class is inlined in the same file as the test.I want it to be in a separate file.

3 comments
Comment actions Permalink

Hello vibhu,

After you created class, you can use Move refactroing and move it to separate
file (correctly named) instantly.

Sincerely,
Ilya Ryzhenkov

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


v> When i am working in a unit test, and have a class in my test that
v> does not exist
v> TestAccountHasAnID(){
v> Account acct = new Account()
v> Assert.IsTrue(acct.Id>0)
v> }
v> Is there a way i can tell Account class to be generated in a seperate
v> file as soon as i write this much code.
v>
v> When i create a class, the class is inlined in the same file as the
v> test.I want it to be in a separate file.
v>


0
Comment actions Permalink

I was doing that. It would be awsone when I do the create class it does it in a seperate file and makes it public. Is there a way i can change the internal to public.

0
Comment actions Permalink

Hello vibhu,

In the Resharper 2.0.* there is a context action to change type access modifier.
Just put caret onto existing modifier (internal in your case) and hit Alt-Enter
or click the light bulb, then select intended action.

Currently there is no Quick Fix to create type in the new file with public
modifier. You can submit request to our tracking software (http://jetbrains.net/jira/browse/RSRP)
to track decisions and completion of it.

Alternatively you can create plugin to Resharper which will add that very
Quick Fix. If you wish to go this way - welcome to jetbrains.resharper.openapi
newsgroup.

Sincerely,
Ilya Ryzhenkov

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


v> I was doing that. It would be awsone when I do the create class it
v> does it in a seperate file and makes it public. Is there a way i can
v> change the internal to public.
v>


0

Please sign in to leave a comment.