Re: Re: TDD productivity resharper plugin crash

7 views
Skip to first unread message

Paul Batum

unread,
Nov 29, 2008, 10:53:28 PM11/29/08
to tdd-product...@googlegroups.com
Hi Eric,

Attached is a screenshot containing my solution and the option I am selecting. I believe this is the second feature that you discussed below. The thing is, I don't want it to recreate the folder structure to match the namespace of my test class. I would prefer it if it dumped the class into the default namespace for the specified project. So in the case demonstrated by my screenshot, I would expect an Asdf.cs file to appear in the FluentNHibernate2 project, with the contents:

namespace FluentNHibernate
{
  class Asdf {}
}

Notice the namespace is missing the 2 on the end... this is because the default namespace for that project is just "FluentNHIbernate" not "FluentNHibernate2".

Does that make sense?

Paul Batum

On Sun, Nov 30, 2008 at 12:31 PM, <Eric....@gmail.com> wrote:
The are two quick fixes in the current version.

The first is the quick fix that was in the original blog post.. when an class is defined in the class file and the yellow light bulb is displayed to create the class in a new file in a referenced project. The other quick fix is a red light buld which shows up when you create a statment to define and instantiate a class or interface that does not yet exist. That second feature will"is supposed to" create a folder structure that maps the namespace taken from the test class. This is a feature that I have been fighting the resharper api, it will create the files but does not properly recongize the new project folders. It breezed past the link you sent me and assumed that the error you recieved was part of that feature. It sounds like you are using the first quick fix.

Can you send me a screen shot of your solution explorer? I can recreate the folder structure that you were using to determine why the create folder method is blowing up.

ps. I just created a google group if you are interested in joining that. I have another person who has contributed some additional functionality and I would like to formalize the support a little bit, via a group. You can join the group here. http://groups.google.com/group/tdd-productivity-plugin


Thanks,
Eric

resharper_tdd_productivity.jpg

Eric Hexter

unread,
Dec 1, 2008, 2:39:35 PM12/1/08
to tdd-product...@googlegroups.com
It looks like this issue is releated to the folder creation I have been fighting with.  It looks like your namespace of the class file does not contain the default namespace for the assembly.  Thus it is trying to create folders in the code assembly.  My guess is your test assembly has a default namespace of FluentNhibernate2.Testing since the test class has a namespace of FluentNHibernate.Testing the plugin wants to create folder in the code project for FluentNHibernate.Testing. 
 
The namespace algorithm first removed the default namespace from the namespace of the test class than uses the remaining portion of the namespace for the new class.
 
Take this as an example:
 
MyProject.Tests -> project   has a default namespace of MyProject.Tests
In a test file, I have the namespace MyProject.Tests.Services
 
When I create a class in another project.. say MyProject.  The plugin will create a folder "Services" in the project since it was the remaning part of the namespace from the test after removing the default namespace. 

Paul Batum

unread,
Dec 1, 2008, 7:25:08 PM12/1/08
to tdd-product...@googlegroups.com
Hi Eric,

I tried with the new version, it still crashes, though the stacktrace appears to be different. Just to be clear: my test project does not have the default namespace of FluentNhibernate2.Testing as you suspected, its been changed in the same way the other project was: the 2 was removed.

I can send you the stacktrace but I thought it might be easier if I actually send you a solution that replicates the problem. All I did was create a solution with two class libraries, change the default namespace for each and then add a project reference. See the attached file.

Paul Batum
CrashDemo2.zip

Eric Hexter

unread,
Dec 1, 2008, 9:38:50 PM12/1/08
to tdd-product...@googlegroups.com
Thanks so much for working with me on this.  I will run through this and figure out why this is happening.

Eric Hexter

unread,
Dec 1, 2008, 11:27:41 PM12/1/08
to tdd-product...@googlegroups.com

I got a fix to that use case. Thanks so much for sending it in.  I think the current version is stable. 

Paul Batum

unread,
Dec 1, 2008, 11:38:15 PM12/1/08
to TDD Productivity Plugin
No problems at all Eric. Let me know when you have a fix ready for me.

Eric Hexter

unread,
Dec 1, 2008, 11:56:51 PM12/1/08
to tdd-product...@googlegroups.com
The installer is on the project site now. Version 1.0.0.40094

Paul Batum

unread,
Dec 2, 2008, 12:07:49 AM12/2/08
to tdd-product...@googlegroups.com
Works a treat Eric. Thanks!

Eric Hexter

unread,
Dec 2, 2008, 9:41:16 AM12/2/08
to tdd-product...@googlegroups.com
Let me know if you have any ideas for new features!
 
Thanks,
Eric
Reply all
Reply to author
Forward
0 new messages