views:

340

answers:

2

I am playing around with WF4 beta 2 and want to unit test a workflowservice. Perhaps I am missing something, but this does not seem trivial.

As far as I can see, I might use WorkflowServiceHost. But I think this is a lot of overhead to create a host and then consume it in the test.

Is there not a simple way of testing a workflow service just as with WorkflowInvoker.Invoke?

+2  A: 

have a look at link text

Sebastian Sedlak
+1  A: 

Depends partly on how you factor things.

You can unit test your application logic by wrapping it up as a custom activity with InArguments and OutArguments that are set by the service. (You can pass arguments when use WorkflowInvoker.)

In order to unit test your service as a whole, I don't know a good way to do this other than actually creating the service host.

Also, if your application logic depends on Pick activity or Parallel receive, you probably want to do something more advanced in order to test the different execution paths of the Pick/Parallel scenario.

Tim Lovell-Smith