Windows Workflow Foundation 3


question on unit testing workflows


I am writing a unit test against a workflow (call it ExecuteMessageWorkflow) that executes another workflow provided as input.    I created a test workflow (UnitTestWorkflow) which becomes the input for ExecuteMessageWorkflow.  I will pass the UnitTestWorkflow type to the ExecuteMessageWorkflow which will execute an instance of UnitTestWorkflow.
 
How can I get my test workflow to let my unit test code it has run successfully?   I was thinking of using a semaphore but I dont if that will work.  
 
I thought about having the test workflow write a file.   That just seems hokey.   All I need to know is that ExecuteMessageWorkflow successfully excuted my test workflow UnitTestWorkflow. Any suggestions?
 
Matt
Matt,
 
I am experimenting with using CallExternalMethodActivity to see if it will work for what you want to do. I was thinking your UnitTestWorkflow could include this activity and call a method on an interface you define in your host/service. You can read more about it at http://msdn.microsoft.com/en-us/library/ms734739.aspx.  It will probably take me a couple of days to try it out. I will get back to you with results.
 
Jim
 
Questions for further clarification:
 
Does the ExecuteMessageWorkflow create a separate WorkflowRuntime in order to run the "input" workflow?
 
How do you pass the type of the UnitTestWorkflow to the ExecuteMessageWorkflow? 
 
Thanks.
 
Jim
 
 
After some validation, ExecuteMessageWorkflow adds an InvokeWorkflowActivity to its activity "list" setting its target to the input.    The target for the InvokeWorkflowActivity in the case of my unit test will be UnitTestWorkflow.  So to answer your question, ExecuteMessageWorkflow does not create a separate WorkflowRuntime.   (It could be refactored to if thats a better choice).
 
The input into ExecuteMessageWorkflow loads from a row from a database that specifies assembly file name and the class name.   ExecuteMessageWorkflow finds and loads the assembly and gets the type from it.   In the case of my unit test it will get the assembly "unittest.api.dll" and type "UnitTestWorkflow" from the database.   The fields in the database row are strings.  Using the Assembly class I can get a type instance from it.
 
Matt
Matt,
 
I am experimenting with using CallExternalMethodActivity to see if it will work for what you want to do. I was thinking your UnitTestWorkflow could include this activity and call a method on an interface you define in your host/service. You can read more about it at http://msdn.microsoft.com/en-us/library/ms734739.aspx.  It will probably take me a couple of days to try it out. I will get back to you with results.
 
Jim
 
Actually, on further reflection, using the tracking services framework may be the best way to go. Have a look at http://msdn.microsoft.com/en-us/library/ms735887.aspx.
 
Jim
 
Tracking is probably the appropriate, however I'm taking your previous suggestion with using CallExternalMethod.
 
Thnx for the help.   This is good
 
Matt

Related Links

Problem with sendmail Activity
Global Run Time Variable
To use dependency properties or not
OwnershipTimeoutSeconds
Problem in WorkflowRuntime.WorkflowCompleted event
HandleExternalEvent Problem
WWF with .NET compact framework 2.0
How can I query StateMachineWorkflowInstance before the WF idles
Question about modifying a workflow
Rule Conditions against custom activities and XAML activation - how should I achieve this?
MOSS Publishing Site
WF custom persistence once again
Hands on Labs 2.2
WF Virgin
Error in the Hands on lab 09
Workflow Designer

Categories

MSDN
Microsoft Office for D...
Commerce Server
Development
Archived Forums I-L
Archived Forums SA-SM
In-App Advertising (Ad...
Open source Developmen...
Where is the Forum For…?
Visual Basic
Parallel Computing in ...
DirectShow Development
Windows Desktop Optica...
Application Security f...
Windows Desktop Sideba...
Windows Desktop Debugging
Windows Desktop Perfmo...
SharePoint Legacy Vers...
Azure Storage
Azure SQL Database
Azure Multi-Factor Aut...
Azure Media Services
Azure Mobile Apps
Azure Marketplace
Azure DocumentDB
Azure Batch
Azure Log Analytics
Azure Data Lake Analyt...
Team Foundation Server...
Architecture General
BizTalk ESB Toolkit
WCF Data Services
HealthVault Developer
ISV Open Discussions
Small Basic
SyncFx - General [Read...
Visual Studio Smart De...
SQL Server Reporting S...
Transact-SQL
.NET Framework inside ...
SQL Server Express
SQL Server 2012 Analys...
Windows Forms General
Windows Forms Data Con...
Windows Server 2008 Ap...
Windows Live General: ...
MSDN Subscriptions Fee...
Known Issues for Windo...
Bing Maps WPF, WP7/8/8...
Bing Maps for Windows ...
Windows File Sharing P...
Project Server - Setup...
MVVM / ViewModel Patte...
Designing with Silverl...
Expression Web and Sup...
Surface Application De...
Retired SharePoint Exc...
Retired SharePoint Acc...
Retired SharePoint Col...
Project Online General...
.NET Framework 4 Appli...
.NET Framework 4 Relea...
.NET Remoting and Runt...
Announcements about pr...
Architecture Events
Architecture, Tools, a...
Azure Troubleshooting,...
Commerce Server 2002 a...
Core Coding Experience...
Deep Zoom Composer
Expression Community S...
Game Technologies: Gen...
ISV Community Days
Microsoft Security Dev...
Microsoft Unified Comm...
MS-Build, Multi-Target...
Monitor, Alert and Aut...
Network Quality of Ser...
Office Live Small Busi...
Popfly Bugs and Sugges...
Oracle on Azure
Search Server: Frequen...
Service Bus EAI & EDI ...
Share your How to samp...
SyncFx - Feedback [Rea...
SQL Azure Labs Support
SQL Server 2014 In Azu...
SQL Server 2014 Master...
Team Foundation Server...
Transactions Programming
Visual Basic Power Packs
Visual C++ 2008 (Pre-r...
Visual Studio Team Ser...
Visual Studio Editor i...
Visual Studio Guidance...
Visual Studio Team Sys...
Web Development in Vis...
Windows SideShow Devel...
XML Paper Specificatio...
Windows Phone Preview ...
OneDrive Development (...
Maps In Windows - APIs
Microsoft Graph

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile