Answers Logo
Search


How do you structure your unit tests?



I put my unit tests in a separate project from the application.

I put my unit tests in the same project as the application

Other:

Vote

View The Results of This Poll



5 Comments
2008-04-10 15:04:19 ET

In short: Testing of private methods limits the refactoring ability. Thanks to InternalsVisibleTo we can easily test internal members Having that in mind, I really don't see the reason why to keep code and test in the same project

2008-04-11 10:18:16 ET

When we were using Web Site Project with ASP.NET (not Web Application Project) we had to put the unit tests in the same place because we didn't have proper DLLs and it was difficult to manage dependencies without copying DLLs, etc.. When we migrate to Web.App. Project we plan to change this.

Tom
2008-04-12 05:40:32 ET

Thanks to Nikola Malovic. Before now I've kept my NUnit .NET tests in the same assembly, but I'll investigate the InternalsVisibleTo attribute. I don't want to ship my unit tests!

PK
2008-04-13 18:58:45 ET

Solution structure:- *Web Application\ - Model - Model Unit Tests - MVC Application - MVC Application Unit Tests *>Some Project - eg. SilverLightEncoder Server< *>Another project< *Solution Items

2008-04-14 06:02:12 ET

For every type in my project, I have a corresponding type that end in 'Spec', for example, SomeObject has a unit test called SomeObjectSpec. I've found this gets around some of the resistance from managers (and sometime other developers) who's opinion is that we don't need "Unit Tests". They have more of a difficult time saying No to the questions of "Do we need specifications?" ! Cheers, Steve


Leave a comment

Name *

Please enter your name below.

Email Address *

Your email address will not be published. (We add your Gravatar icon if you have one)

Please enter a valid email address below.

Your Website URL

Comment *

Maximum of 4000 chars. (0/4000)

Please enter a comment below.

(Fields marked * are mandatory)


Submit Comment
Spam controlled by Akismet

Poll Author

http://haacked.com/...

View My Previous Polls

My Website

Share Link

Use the link below to share this poll.

Embed This Poll

You can also place this poll on your website or blog as a widget. Simply copy and paste the code below into your HTML.