How to unit test the windows workflows?
            Asked
            
        
        
            Active
            
        
            Viewed 3,918 times
        
    9
            
            
        - 
                    1Please specify your question and give an example, as it seems too broad right now. What are you looking for exactly? – Kena Oct 08 '08 at 13:41
 - 
                    I think Workflow activities are relatively testable. Here's an entry from my blog about unit testing Workflow activities: http://www.unit-testing.net/CurrentArticle/How-To-Write-Unit-Tests-For-Workflow-Activities.html – T123 Mar 06 '12 at 05:30
 - 
                    See similar question already asked: > [Unit/Automated Testing in a workflow > system](http://stackoverflow.com/questions/143183/unitautomated-testing-in-a-workflow-system) – Ray Oct 22 '08 at 16:44
 
3 Answers
6
            
            
        - 
                    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 Aug 27 '10 at 03:12
 
4
            
            
        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.
        TrueWill
        
- 25,132
 - 10
 - 101
 - 150
 
- 
                    @jlafay Have you found it possible to test the value of a variable in a workflow service? Please look at this [post](http://stackoverflow.com/questions/9672878/assert-the-value-of-a-wf-service-variable-during-a-unit-test) and let me know what you think. – Mike Perrenoud Mar 13 '12 at 14:51
 
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.