Assembly Resolution for Unit Tests
A common problem in writing test automation against an API is that you need to be able to load the assemblies containing the code under test (CUT) into the test process. There are several options which have been employed in the past to ensure that it is possible to load these assemblies including copying the CUT assemblies next to the test assemblies, copying the test assemblies next to where the CUT assemblies are deployed before running the tests, and setting up custom assembly resolvers. Each of these has their drawbacks when you start trying to execute your tests in different environments. For example copying the CUT assemblies next to the tests may work great on your development machine, but when you want to also run these tests in a lab against the installed product a better solution is needed. In VS 2010 we have incorporated an assembly resolution solution directly into the unit test framework which will allow you to easily configure where the dependencies of your tests get loaded from. The assembly resolution settings can be configured by opening up Test Settings and navigating to the “Unit Test” section. Below is a screenshot of the settings for reference as we go through what each of them are for: These assembly resolution settings will be used for all tests that are executed in the run and will override any assembly resolution settings which were put into the test projects App.Config file (more later in this post about the assembly resolution settings that can be put into the App.Config file).

See the original post:
Assembly Resolution for Unit Tests


