How do I make fun of a WCF service call when using the Send or Send operation in WF4?

Since besides my workflow, I need to make a call to an external WCF service to retrieve some objects. The problem is that I don’t see how to mock the WCF service that will be triggered by the submit action. Does anyone know how I can do this?

Thanks, John

+7
workflow mocking workflow-foundation workflow-foundation-4
source share
2 answers

The best answer I've found so far is Ron Jacobs, who made a couple of blog posts on this post using his XamlInjector. This is the last:

http://blogs.msdn.com/b/rjacobs/archive/2011/01/20/wf4-how-to-unit-test-a-workflow-that-calls-a-wcf-service.aspx

+1
source share

You can wrap it in your own interface / class so that it can be ridiculed, or you could mock it with an interface that is included in the generated code:

public partial class FooClient : System.ServiceModel.ClientBase<YourApp.FooService.IFooService>, YourApp.EntitiesService.IFooService { ... } 
0
source share

All Articles