示例#1
0
        public void AgreeReturnTwiceThenWithdrawTest()
        {
            IWfActivity activityB = ReturnExecutorTestHelper.PrepareAndMoveToAgreeSelectorActivity();

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

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

            Console.WriteLine("退回之前");
            Console.WriteLine("当前活动{0}", activityB.Process.CurrentActivity.Descriptor.Key);
            ReturnExecutorTestHelper.OutputMainStream(activityB.Process);
            ReturnExecutorTestHelper.OutputEveryActivities((activityB.Process));

            MoveAgreeProcessOneStepAndValidate(activityB.Process, 1);

            WfProcessTestCommon.MoveToNextDefaultActivity(activityB.Process);   //To N2(B)

            Console.WriteLine("第二次退回之前");
            Console.WriteLine("当前活动{0}", activityB.Process.CurrentActivity.Descriptor.Key);
            ReturnExecutorTestHelper.OutputMainStream(activityB.Process);
            ReturnExecutorTestHelper.OutputEveryActivities((activityB.Process));

            Assert.AreEqual("N2", activityB.Process.CurrentActivity.Descriptor.Key);

            MoveAgreeProcessOneStepAndValidate(activityB.Process, 2);

            Console.WriteLine("第二次退回之后");
            Console.WriteLine("当前活动{0}", activityB.Process.CurrentActivity.Descriptor.Key);
            ReturnExecutorTestHelper.OutputMainStream(activityB.Process);
            ReturnExecutorTestHelper.OutputEveryActivities(activityB.Process);

            Assert.AreEqual("N3", activityB.Process.CurrentActivity.Descriptor.Key);
        }
示例#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");
        }
示例#3
0
        public void AgreeReturnOnceThenWithdrawTest()
        {
            IWfActivity activityB = ReturnExecutorTestHelper.PrepareAndMoveToAgreeSelectorActivity();

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

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

            Console.WriteLine("退回之前");
            Console.WriteLine("当前活动{0}", activityB.Process.CurrentActivity.Descriptor.Key);
            ReturnExecutorTestHelper.OutputMainStream(activityB.Process);
            ReturnExecutorTestHelper.OutputEveryActivities((activityB.Process));

            MoveAgreeProcessOneStepAndValidate(activityB.Process, 1);

            Console.WriteLine("撤回之前");
            Console.WriteLine("当前活动{0}", activityB.Process.CurrentActivity.Descriptor.Key);
            ReturnExecutorTestHelper.OutputMainStream(activityB.Process);
            ReturnExecutorTestHelper.OutputEveryActivities((activityB.Process));

            IWfProcess process = DoWithdrawExecutor(activityB.Process);

            activityB.Process.Descriptor.Output();

            Console.WriteLine("撤回之后");
            Console.WriteLine("当前活动{0}", process.CurrentActivity.Descriptor.Key);
            ReturnExecutorTestHelper.OutputMainStream(process);
            ReturnExecutorTestHelper.OutputEveryActivities(process);
            activityB.Process.Descriptor.Output();

            //activityB.Process.Descriptor.Output();

            //ReturnExecutorTestHelper.ValidateMainStreamActivities(activityB.Process, "A", "B", "C", "D", "F");
        }
示例#4
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");
        }
示例#5
0
        public void ReturnOnceThenWithdrawTest()
        {
            IWfActivity activityD = ReturnExecutorTestHelper.PrepareAndMoveToSpecialActivity();

            int originalActivityCount = activityD.Process.Activities.Count;

            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);

            IWfProcess process = DoWithdrawExecutor(activityD.Process);

            Console.WriteLine("撤回之后");
            ReturnExecutorTestHelper.OutputMainStream(process);
            ReturnExecutorTestHelper.OutputEveryActivities(process);

            Assert.AreEqual(originalActivityCount, process.Activities.Count, "撤回后与退件前的活动数一样");
            Assert.AreEqual(originalActivityCount, process.Descriptor.Activities.Count, "撤回后与退件前的活动数一样");
        }
示例#6
0
        public void ReturnTwiceThenWithdrawTwiceTest()
        {
            IWfActivity activityD = ReturnExecutorTestHelper.PrepareAndMoveToSpecialActivity();

            int originalActivityCount = activityD.Process.Activities.Count;

            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);

            IWfProcess process = process = DoWithdrawExecutor(activityD.Process);

            Console.WriteLine("第一组撤回之后");
            ReturnExecutorTestHelper.OutputMainStream(process);
            ReturnExecutorTestHelper.OutputEveryActivities(process);

            process = DoWithdrawExecutor(activityD.Process);    //C1;
            process = DoWithdrawExecutor(activityD.Process);    //B1
            process = DoWithdrawExecutor(activityD.Process);    //A1

            process = DoWithdrawExecutor(activityD.Process);

            Console.WriteLine("第二组撤回之后");
            ReturnExecutorTestHelper.OutputMainStream(process);
            ReturnExecutorTestHelper.OutputEveryActivities(process);

            Assert.AreEqual(originalActivityCount, process.Activities.Count, "撤回后与退件前的活动数一样");
            Assert.AreEqual(originalActivityCount, process.Descriptor.Activities.Count, "撤回后与退件前的活动数一样");
        }
示例#7
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");
        }