I am currently working on a C# solution in VS 2010.
In order to write sufficient unit tests for my business processes I am using the Accessor approach to access and change the internals of my business objects.
The issues that has arisen on my TFS build server now that I have added Accessors to my objet assembly in a number of other test assemblies, when my test run not all the test pass, some fail with a warning along the lines of:
... <Test failed message> .... ... Could not load file 'ObjectLibrary_Accessor, Version=0.0.0.0, Culture=neutralm PublicKeyToken=ab391acd9394' or one of its dependencies. ... ...
I believe the issue is that as each test assembly is compiled a ObjectLibrary_Accessor.dll is created with a different strong name. Therefore when some of the tests are compiled the strong name check fails with the above error even-though the dll is in the expected location.
I see a number of options, none of which are particularly attractive, these include:
- Not using the _Accessor approach.
- Set a different XX_Accessor.dll for each test assembly - Is it possible to change the name of the generated assembly to avoid the clash?
- Change my integration build to use a different binaries folder for each test project(how?)
- Other options I do not know about?
I would be interested in any advice or experience people have had of this issue, solutions and workarounds (although I do not have time to change my code so option 1 is not a favorate).