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

  • SEARCH
  • Home
  • 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 4028684
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:15:04+00:00 2026-05-20T11:15:04+00:00

Is it better to have a unit-test project per solution or a unit-test project

  • 0

Is it better to have a unit-test project per solution or a unit-test project per project?

With per solution, if you have 5 projects in the solution you end-up with 1 unit-test project containing tests for each of the 5 projects.

With per project, if you have 5 projects in the solution you end-up with 5 unit-test projects.

What is the right way?

I think it’s not the same question as Write Unit tests into an assembly or in a separate assembly?

  • 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-20T11:15:05+00:00Added an answer on May 20, 2026 at 11:15 am

    Assemblies are a packaging/deployment concern, so we usually split them out because we don’t want to deploy them with our product. Whether you split them out per library or per solution there are merits to both.

    Ultimately, you want tests to be immediately available to all developers, so that developers know where to find them when needed. You also want an obstacle free environment with minimal overhead to writing new tests so that you aren’t arming the cynics who don’t want to write tests. Tests must also compile and execute quickly – project structure can play a part in all of this.

    You may also want to consider that different levels of testing are possible, such as tests for unit, integration or UI automation. Segregating these types of tests is possible in some tools by using test categories, but sometimes it’s easier for execution or reporting if they are separate libraries. 

    If you have special packaging considerations such as a modular application where modules should not be aware of one another, your test projects should also reflect this.

    In small projects where there aren’t a lot of projects, a 1:1 ratio is usually the preferred approach. However, Visual Studio performance quickly degrades as the number of projects increases. Around the 40 project mark compilation becomes an obstacle to compiling and running the tests, so larger projects may benefit from consolidating test projects. 

    I tend to prefer a pragmatic approach so that complexity is appropriate to the problem.  Typically, an application will be comprised of several layers where each layer may have multiple projects.  I like to start with a single test library per layer and I mimic the solution structure using folders. Divide when complexity warrants it. If you design your test projects for flexibility then changeover is usually painless.

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

Sidebar

Related Questions

Actually, I'm using this way. Do you have a better way? private bool AcceptJson(HttpRequest
I decided to add unit tests to my project and continue development in a
I have an application where many unit tests use a real connection to an
I have a bunch of repository classes which I want to unit-test using Visual
In C++, I have often made a unit test class a friend of the
Just embarking on using a test framework for writing unit tests and also the
Here we go again, the old argument still arises... Would we better have a
I have a team of junior developers and they want to have better understanding
I'm currently using Intelligencia.UrlRewriter does anyone have better suggestions?
Are there good reasons why it's a better practice to have only one return

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.