Pergunta

I'm trying to test my WF4 State Machine workflow. A few of the transitions are triggered by Receive activities and, based on the data in the message, make the the appropriate transition. Right now I'm using the WorkflowApplicationTest to run my tests, but am only able to test my timeout pathing, since any other transitions are triggered by this receive. I've looked at using the XamlInjector to mock the Receive, but it looks like it only works with custom activities. I also tried making a custom Receive activity so that I could mock that, but couldn't figure out everything I needed to do to make my custom receive work or find any info on creating custom Receive activities.

Is there a simple solution that I am overlooking on how to test this? And if a custom Receive is the only way to be able to use the XamlInjector, how do I write one?

I am using the Visual Studio test framework for my unit tests.

Foi útil?

Solução

I've got just the thing for you. See How do I Mock Receive and Send activities?

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top