.net - Single vs. Multiple Unit Test Projects per Solution? -


i have typically had 1:1 mapping between product assemblies , unit test assemblies. try keep overall number of assemblies low, , typical solution may like...

  • client (contains views, controllers, etc)
  • client.tests
  • common (contains data/service contracts, common utilities etc)
  • common.tests
  • server (contains domain, services, etc)
  • server.tests
  • server.webhost

lately @ work, people have been mentioning having single unit test project vs. breaking them down assembly testing. know in day, made life easier if running ncover etc part of build (no longer matters of course).

what general rational behind single vs. multiple unittest projects? other reducing number of projects in solution, there concrete reason go 1 way or other? impression may 1 of "preference" things, googling hasn't turned much.

there no definite answer because depends on work on personal taste. however, you want arrange things in way can work effectively.

for me means, want find things quickly, want see tests what, want run smaller things have better control in case want profile or other things on tests well. when you're debugging failing tests. don't want spend time figuring out, should speak how things mapped , belongs what.

another important thing me want isolate as possible , have clear boundaries. want provide easy way refactor/move out parts of big project independent project.

personally, arrange tests around how software structured means one-to-one mapping between class , tests, library , test executable. gives nice test structure mirrors software structure, in turn provides clarity finding things. in addition, provides natural split in case moved out independently.

this personal choice after trying various ways things.

in opinion, grouping things when there many not thing. can be, believe in context of discussion wrong argument single test project. many test projects many files inside means 1 lot of test files. believe real problem solution you're working on getting big. maybe there other things can avoid having "one world"? :)


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -