Exemplo n.º 1
0
        public void ReturnTwiceTest()
        {
            IWfActivity activityD = ReturnExecutorTestHelper.PrepareAndMoveToSpecialActivity();

            Assert.AreEqual("D", activityD.Descriptor.Key);
            ReturnExecutorTestHelper.OutputMainStream(activityD.Process);
            ReturnExecutorTestHelper.OutputEveryActivities(activityD.Process);

            //第一次退回
            ReturnExecutorTestHelper.ExecuteReturnOperation(activityD, "A");

            Console.WriteLine("第一次退回后");
            ReturnExecutorTestHelper.OutputMainStream(activityD.Process);
            ReturnExecutorTestHelper.OutputEveryActivities(activityD.Process);

            WfProcessTestCommon.MoveToNextDefaultActivity(activityD.Process);   //B1
            WfProcessTestCommon.MoveToNextDefaultActivity(activityD.Process);   //C1
            WfProcessTestCommon.MoveToNextDefaultActivity(activityD.Process);   //D1

            Assert.AreEqual("D", activityD.Process.CurrentActivity.Descriptor.AssociatedActivityKey);

            //在B的出线C和E之间选择E
            activityD.Process.ApplicationRuntimeParameters["IsCLine"] = false;

            //第二次退回
            ReturnExecutorTestHelper.ExecuteReturnOperation(activityD, "A");

            Console.WriteLine("第二次退回后");
            ReturnExecutorTestHelper.OutputMainStream(activityD.Process);
            ReturnExecutorTestHelper.OutputEveryActivities(activityD.Process);

            ReturnExecutorTestHelper.ValidateMainStreamActivities(activityD.Process, "A", "B", "E", "D", "F");
        }
Exemplo n.º 2
0
        public void AgreeReturnTwiceTest()
        {
            IWfActivity activityB = ReturnExecutorTestHelper.PrepareAndMoveToAgreeSelectorActivity();

            Assert.AreEqual("B", activityB.Descriptor.Key);

            SetToLineAndMSLineSelected(activityB, "C", false);
            SetToLineAndMSLineSelected(activityB, "A", true);

            Console.WriteLine("第一次退回之前,不同意");
            ReturnExecutorTestHelper.OutputMainStream(activityB.Process);
            ReturnExecutorTestHelper.OutputEveryActivities(activityB.Process);

            MoveAgreeProcessAndValidate(activityB.Process, 1);

            Console.WriteLine("第二次退回之前,同意");
            ReturnExecutorTestHelper.OutputMainStream(activityB.Process);
            ReturnExecutorTestHelper.OutputEveryActivities(activityB.Process);

            MoveAgreeProcessAndValidate(activityB.Process, 2);

            Console.WriteLine("第二次退回之后,同意");
            ReturnExecutorTestHelper.OutputMainStream(activityB.Process);
            ReturnExecutorTestHelper.OutputEveryActivities(activityB.Process);

            ReturnExecutorTestHelper.ValidateMainStreamActivities(activityB.Process, "A", "B", "C", "D", "F");
        }
Exemplo n.º 3
0
        public void ReturnOnceTest()
        {
            IWfActivity activityD = ReturnExecutorTestHelper.PrepareAndMoveToSpecialActivity();

            Assert.AreEqual("D", activityD.Descriptor.Key);
            ReturnExecutorTestHelper.OutputMainStream(activityD.Process);
            ReturnExecutorTestHelper.OutputEveryActivities(activityD.Process);

            ReturnExecutorTestHelper.ValidateMainStreamActivities(activityD.Process, "A", "B", "C", "D", "F");

            ReturnExecutorTestHelper.ExecuteReturnOperation(activityD, "A");

            IWfActivity returnedActivity = activityD.Process.CurrentActivity;

            Assert.AreEqual("A", returnedActivity.Descriptor.AssociatedActivityKey);
            Assert.AreEqual(activityD.ID, returnedActivity.CreatorInstanceID);
            ReturnExecutorTestHelper.ValidateBRelativeActivityOutTransitions(activityD.Process.CurrentActivity);

            ReturnExecutorTestHelper.OutputMainStream(activityD.Process);
            ReturnExecutorTestHelper.OutputEveryActivities(activityD.Process);

            ReturnExecutorTestHelper.ValidateMainStreamActivities(activityD.Process, "A", "B", "C", "D", "F");
        }