Looking to include unit tests in a whole host of new solutions. Not sure how to structure them.
Not sure if it really matters, though these are all .Net C# projects.
I have read many similar answers, such as this one Organization of Unit Tests in Visual Studio and this one Do you put unit tests in same project or another project? but none appear to address projects that are shared across multiple solutions
Given the structure of the 2 solutions below, what would be best-practice for creating unit test projects.
Solution #1
- Data - Solution Folder
- MyData - Project
- Global - Solution Folder
- Global.Project.1 - project
- Global.Project.2 - project
- Global.Project.3 - project
- Global.Project.4 - project
- Services - Solution Folder
- Service.Project.1 - project
- Service.Project.2 - project
- Web - Solution folder
- MyWebsite - project
Solution #2
- Data - Solution Folder
- MyData - Project
- Global - Solution Folder
- Global.Project.1 - project
- Global.Project.2 - project
- Services - Solution Folder
- Service.Project.1 - project
- App - Solution folder
- MyConsoleApp - project
Notice that there are some projects that are shared between the solutions.
So the question, what are the typical approaches to these?
Would we create a test project per project?
Or a single test project per solution?
Or some hybrid between the two, perhaps a solution of their own
Any pitfalls that come to mind over the different approaches?