12
Shouts

How To Unit Test Workflows–Mocking Activities - Ron Jacobs

published 995 days, 2 hours, 33 minutes ago posted by AlexAlex 996 days, 23 hours, 25 minutes ago
Wednesday, September 29, 2010 12:18:45 PM GMT Monday, September 27, 2010 3:26:16 PM GMT

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...

category: Architecture | clicked: 2 | | source: blogs.msdn.com | show counter code
tags: WF4, workflow, Mocking, Unit Test