Answers Logo
Search

You can view polls created in the following languages.
English
German
French
Spanish
Dutch
Romanian
Norwegian
Portugese
Serbo Croatian
Arabic

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




5 Comments
Apr 10, 2008 3:04pm 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

Apr 11, 2008 10:18am 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
Apr 12, 2008 5:40am 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
Apr 13, 2008 6:58pm ET

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

Apr 14, 2008 6:02am 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


Poll Author

http://haacked.com/...

View all polls by this user


My Website



Results

Click on the link below to see the results of this poll.

View Poll Results