One of the new features included with Visual Studio 2012 is the Fakes Framework which offers the ability to detour code at runtime and isolate functionality for true unit testing, regardless of whether the code was written with testing in mind.
I began speaking on Fakes back when it was a beta product from Microsoft Research called Moles. While the core functionality remains the same, Microsoft has streamlined the implementation and now calls the detour mechanism a shim rather than a mole.
If you have attended this or another of my talks at a user group or conference, please take a moment to share your feedback on SpeakerRate.
The PowerPoint is available on SlideShare and below are links to the code demonstrated in the presentation.
Demos
Y2K Checker (simple introduction)
DateTime Audit (avoiding non-deterministic tests)
File Reader (shimming file system access)
Repository (stubbing interfaces)
Resources
Visual Studio 2011
Fakes MSDN Documentation
Tuesday, May 8, 2012
Testing the Untestable with VS2012 Fakes
Tuesday, May 08, 2012
demo, development, fakes, microsoft, moles, presentation, testing, training, unit testing, Visual Studio, VS2012
1 comment
posted by
Gaines Kergosien
Subscribe to:
Post Comments (Atom)
I had a look to your presentation, it was nice to have a complete overview on unit testing. Simple explanation on delegates, stubs, interfaces and shims but still useful to me being in the software development field. .
ReplyDelete