コード例 #1
0
        public void InvokeWorkflowShouldInvokeInner()
        {
            WorkflowTestTrace.Arrange();
            var childActivity = new TestInnerActivity();
            var target = new InvokeWorkflow();

            // inner dictionary gets passed to child
            var innerInput = InputDictionary.Create("Num", 1);
            var input = InputDictionary.Create("Activity", childActivity, "Input", innerInput);

            var host = WorkflowApplicationTest.Create(target, input);

            try
            {
                WorkflowTestTrace.Act();
                host.TestWorkflowApplication.RunEpisode();
                host.AssertOutArgument.IsNotNull("Result");
                var innerArgs = OutputDictionary.Get<IDictionary<string, object>>(host.Results.Output, "Result");

                WorkflowTestTrace.Assert();
                AssertOutArgument.AreEqual(innerArgs, "Result", 2);
            }
            finally
            {
                host.Tracking.Trace();
            }
        }
コード例 #2
0
        public void InvokeWorkflowShouldThrow()
        {
            var childActivity = new TestInnerActivity();
            var target = new InvokeWorkflow();

            // inner dictionary gets passed to child
            var innerInput = InputDictionary.Create("Num", -1);
            var input = InputDictionary.Create("Activity", childActivity, "Input", innerInput);

            var host = WorkflowApplicationTest.Create(target, input);

            try
            {
                AssertHelper.Throws<ArgumentException>(() => host.TestWorkflowApplication.RunEpisode());
            }
            finally
            {
                host.Tracking.Trace();
            }
        }