How best to organize projects folders for unit tests in .NET?

Posted by Dan Bailiff on Stack Overflow See other posts from Stack Overflow or by Dan Bailiff
Published on 2010-05-19T22:21:36Z Indexed on 2010/05/19 22:40 UTC
Read the original article Hit count: 183

Filed under:
|
|

So I'm trying to introduce unit testing to my group. I've successfully upgraded a VS'05 web site project to a VS'08 web application, and now have a solution with the web app project and a unit test project.

The issue now is how to fit this back into the source repository such that we don't break the build system and the unit test projects are persisted as well.

Right now we have something like this:

c:\root
c:\root\projectA
c:\root\projectB
c:\root\projectC

where projectA contains the sln file and all other related files/folders for the project.

Now I have this new solution that looks like this:

c:\root\projectA (parent folder)
c:\root\projectA\projectA (the production code project)
c:\root\projectA\projectA_Test (the unit test project)
c:\root\projectA\TestResults
c:\root\projecta\projectA.sln

How do I integrate this new structure back into the code repository?

I'd really prefer to keep the production code folder where it was in the source repository for the sake of the build, but is this necessary? If I keep the production code project in its usual place then where do I keep my unit test projects and how do I connect them with a sln file?

Is it better to use this new structure and adjust the build process?

I'd love to hear how other people are dealing with this issue of upgrading legacy projects to unit testing.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about unit-testing