How to unit test the windows workflows?
问题:
回答1:
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).
回答2:
Microsoft.Activities.UnitTesting.
A library of helper classes and activities designed to make unit testing of workflows easier.
Looks like there's a Channel 9 video for it on the downloads page, too.
回答3:
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.