views:

471

answers:

3

How to unit test the windows workflows?

+2  A: 

MS dropped the ball on making workflows easily mockable and testable. If you want to do thorough tests on your custom activities you'll need to purchase a mocking framework that can mock sealed types such as TypeMock. Otherwise, you'll have to write your code around the limitations of Workflow.

Will
+4  A: 

K. Scott Allen has posted this, which provides an approach to unit testing custom activities (although he says that he is not satisfied). A similar approach is presented by Ron Jacobs here and here.

Another approach is presented by Maurice here and here (he uses TypeMock as Will already mentioned).

Panos
The Ron Jacobs articles are very promising, especially the second one which contains a sample solution showing how to wire-up the WWF runtime to host the unit tests.
Tim Long
+1  A: 

See similar question already asked:

Unit/Automated Testing in a workflow system

Ray Vega