Wednesday, May 30, 2012

When Running MS Tests within Visual Studio 2010 with an IoC Container in a Loosely-Coupled Architecture

Because an Inversion of Control (IoC) strategy loads assemblies/references at runtime, and to ensure there are no dependencies/references in what should be a loosely-coupled project, ensure that any runtime assemblies required by the IoC container can get to them. In an MS Test environment within Visual Studio 2010, ensure that the 'Enable Deployment' checkbox within 'Test Settings' is unchecked, then ensure any runtime dependencies are handled prior to running any tests by copying & pasting the required assemblies to the test project's Debug/Release folders. This way, MS Test will utilize the project's output directories, not the auto-generated MS Test directories, which would make for a very painful testing strategy, since you'd have to deploy the un-referenced assemblies to each test directory prior to running each test.

No comments: