Image may be NSFW.
Clik here to view.
Clik here to view.

Suppose you want to unit test a workflow that has some external dependency like a database, web service, file or some other thing that makes testing inconvenient. The need to eliminate external dependencies when testing has led to a world of mocking frameworks that allow you to automatically generate a mock with pre-defined behavior.
I wanted to do the same thing with Activities in workflows and I’ve now added support for this to the latest release of the Workflow Test Helper project using a technique I call XAML Injection. The idea is that you deploy the .xaml file for your activity and the XamlInjector class uses it as input to create a test version of the XAML with the mock classes instead of the real ones...