I have two projects, Admin & Analysis, both of which have seperate test projects. Analysis has a dependency on Admin, and every single reference that Analysis has, Admin also have (and then some).
Both are using Moq for unit testing, and both sets of tests pass when run in Visual Studio.
HOWEVER, when I tested them in the build using Kinook Visual Build Pro, both sets of tests fell over - the error was:
Warning: Test Run deployment issue: The assembly or module 'Moq' directly or indirectly referenced by the test container 'C:\Program Files (x86)\Blah\Bin\UnitTest\mynamespace.analysis.tests.dll' was not found.
I found that I can use the DeploymentItem to specify that the Analysis DLL above TestMethod signatures like so:
[DeploymentItem("mynamespace.analysis.dll")]
This fixed all the tests in the build script. I only needed to have it above one of the tests, too.
Now, if I ran Admin after this, all those tests passed too. If I run Admin alone, then all the tests fail still. If I add an Admin DeploymentItem, they still fail... but an Analysis DeploymentItem sorts it out. This is really odd, given the dependencies.
What's going on? What could this be? What can I look into?
Analysis does not point to Moq. They both have the same version of Moq too. Why is Moq only finding it's way into the right location if I add that particular DeploymentItem?
Aucun commentaire:
Enregistrer un commentaire