I’m a bit confused. Got project which is covered by unit tests in different assembly. Co-developer created another project + another unit test assembly too. Now we want to mix some logic between both unit test projects (object factories, some initialization tasks, injection/mocking helpers, etc.). That would cause his project to reference assemblies mine uses.
I found a viewpoint which stands for 1 unit test assembly for all project (sometimes 2, where 2nd contains integration tests). Is this the right way? If not – where to put that shared logic for unit tests?
There are certainly different approaches, there is no single “right way”. This is how we structured our tests:
We have “modules” in our product, which consist of several assemblies. For each “module” we have one single unit test assembly, and one single integration test assembly. We are referencing test assemblies from others this way:
“module X” tests of course never reference “module Y” tests.