Skip to Content
Introducing .NET 4.0: with Visual Studio 2010
book

Introducing .NET 4.0: with Visual Studio 2010

by Alex Mackey
February 2010
Beginner content levelBeginner
400 pages
11h 13m
English
Apress
Content preview from Introducing .NET 4.0: with Visual Studio 2010

6.7. Invoking Workflows

WF4 offers the ability to invoke individual activities without using the workflow runtime. This could be used for scenarios such as unit testing. However, as many workflows will run for a long time, this won't be useful in all instances.

We will now invoke the workflow we created previously and check that requesting ten tickets returns the variable BookingSuccessful set to false. Note that in reality you would write this as a unit test with a framework such as NUnit, but we are just covering the principles here.

  1. Add a new C# console project to the solution called Chapter6.HelloWF.Tests.

  2. Add a reference to System.Activities and Chapter6.HelloWF.

  3. Enter the following using statements in Program.cs:

    using System.Activities; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 3.5 For Dummies®

ASP.NET 3.5 For Dummies®

Ken Cox
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9781430224556Purchase book