Workflow TV - How to test activities and workflow services with XamlInjection
- Posted: Oct 16, 2010 at 11:55 AM
- 36,550 Views
- 3 Comments
Download
How do I download the videos?
- To download, right click the file type you would like and pick “Save target as…” or “Save link as…”
Why should I download videos from Channel9?
- It's an easy way to save the videos you like locally.
- You can save the videos in order to watch them offline.
- If all you want is to hear the audio, you can download the MP3!
Which version should I choose?
- If you want to view the video on your PC, Xbox or Media Center, download the High Quality WMV file (this is the highest quality version we have available).
- If you'd like a lower bitrate version, to reduce the download time or cost, then choose the Medium Quality WMV file.
- If you have a Zune, WP7, iPhone, iPad, or iPod device, choose the low or medium MP4 file.
- If you just want to hear the audio of the video, choose the MP3 file.
Right click “Save as…”
- Mid Quality WMV (Lo-band, Mobile)
- High Quality WMV (PC, Xbox, MCE)
- MP3 (Audio only)
- MP4 (iPod, Zune HD)
In our last episode I showed you the Contoso HR sample application. The Submit Application workflow coordinated database updates, sending of email and multiple web service calls. How can you unit test a workflow like this? You don't want to update databases and send email when testing but you want to be sure that the conditions and correlation queries are correct.
The WorkflowTestHelper project now features XamlInjection which allows you to inject mock activities into the XAML when testing. In this episode I'll show you how I tested the Submit Application workflow using XamlInjection.
Ron Jacobs
blog http://blogs.msdn.com/rjacobs
twitter @ronljacobs
What do you want to see on endpoint.tv?
Comments Closed
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Its good to see that you guys are making the framework easier to test, it would be great to see you guys work with the third party Mocking guys to enable some of this functionality rather than rolling your own mocking framework.
There seem to be a bit of fragility in the test two with magic strings. But looks good.
Cheers
Thanks for the feedback - I hear you. We want to provide ways to work with exisitng mocking frameworks when possible. XAML based workflows are in a special category of thing that other mocking frameworks can't really help you with. Of course once you cross over into the code of an activity then you can always mock at that level with whatever you like
I tried to do the same, but my activity is a slightly more complicated than yours: it contains reference to custom type MyType. I added reference to the type in a unit test project. Nevertheless when I run worflow using your WorkflowInvokeTest class I got an error message: "Cannot create unknown type '{http://schemas.microsoft.com/netfx/2009/xaml/activities}Variable({clr-namespace:Activity_2}MyType)'. So looks like your class works only for simplest cases when there is no references to any custom activity
Remove this comment
Remove this thread
close