Testing windows workflow foundation
-
quinta-feira, 12 de julho de 2012 10:15
Hi,
Am looking at samples that talks about creating NUnits on windows workflows.
Came across these links
but am a beginner in worflows I couldnt follow it much.
Suggest me some good links that would get me started.
I tried the below code on a very simple workflow that has a writeline activity.
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Activities;
namespace UnitTestForWFProgram {
[TestClass]
public class UnitTest1 {
[TestMethod]
public void TestMethod1() {
var output =
WorkflowInvoker.Invoke(new WorkflowForTest());
Assert.AreEqual("Test Message",
output["OutMessage"]);
}
}
}
I want to go one step further and see how testing can be done on medium complex workflows.
Todas as Respostas
-
sexta-feira, 13 de julho de 2012 05:51Moderador
Hi,
Please check Microsoft.Activities.UnitTesting.
Microsoft.Activities.UnitTesting is a unit testing framework designed to make it easier to unit test activities and workflow services built with Windows Workflow Foundation (WF4).
The Framework contains- Test Hosts which wrap WorkflowInvoker, WorkflowApplication and WorkflowServiceHost
- Assert helper classes for asserting out arguments and tracking records
These classes are test framework independent so you can use them with MSTest, NUnit, xUnit or whatever test framework you like. In the walkthroughs we will use MSTest
Microsoft.Activities.UnitTesting
Leo Tang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marcado como Resposta LeoTangModerator quinta-feira, 19 de julho de 2012 02:50

