Shim constructors to isolate “Future Objects”

added by alkampfer
6/14/2012 11:49:38 AM

0 Kicks, 206 Views

This is a third part of a series of articles about the new Unit Test isolating capabilities in Visual Studio 2012. In this post I show how you can isolate creation of objects, to "inject" test double (mock or stub) when the System Under Test directly calls Constructor of objects they depends on and they do not expose any IoC or DI pattern to inject Test Double during test. Thanks to Fakes assembly you can "override" constructor of objects during unit tests.