Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4549262
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:20:09+00:00 2026-05-21T16:20:09+00:00

I’ve researched a few questions questions here on a preferred directory structure for unit

  • 0

I’ve researched a few questions questions here on a preferred directory structure for unit testing and it seems to be personal preference. Most responses fall into seperate test projects within the project foler (MyProject and MyProject\UnitTest), or a mirrored directory structure with a UnitTest top level folder. I’m wondering if TFS is geared to more easily use one methodology over the other and the pros and cons of each (specifically, TFS 2010). Access to references seems to be the biggest concern to me; is this naive? What are some other major considerations when creating a unit testing environment?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:20:10+00:00Added an answer on May 21, 2026 at 4:20 pm

    First off, it makes sense to put unit tests in a separate assembly from the actual code being tested. I know this is probably obvious, but I want to call it out so there is no confusion when you talk of putting tests in the same folder as the project. You don’t want your unit tests in your deployed, production code, so they need to be in a separate assembly. So I recommend a separate unit test project that compiles into a separate assembly. This is consistent with Microsoft guidance and examples.

    The simplest option is to create a unit test project that has project references to the other projects you want to test. This will ensure that all assemblies that those projects reference will be accessible to the unit tests. Visual Studio can access tests in many different structures, but if you are running a build via TFS and executing tests as part of the build, you need to ensure that the build server will be able to resolve all the references in all your projects–not just the unit test project. One good way to do this is to create a “reference library” folder for your solution and copy any 3rd party DLLs you intend to reference there (be sure to add those files to the solution even though nothing is using them yet).

    After the DLLs are copied to that folder and added to the solution, you should add references to the DLLs from that same folder. Then, when you run a build on the build server the DLLs will always be found in the same relative path on the build server as they were found on your own machine when you added the reference in the first place. The references are stored in projects with relative paths, so it makes it so future developers (and the build machine) will be able to resolve the references and won’t get those broken reference issues when they access the code and attempt to compile it for the first time.

    I like to create a single unit test project for my solution, then within that unit test project, create a separate folder (potentially a separate namespace) for each of the projects that I am testing. For example, if my solution has a BusinessLogic project and a Helper project–both of which contain code I want to unit test–I would have a single unit test project that contained two folders: BusinessLogic and Helpers. The tests for each project would be grouped into the appropriate folder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.