public void ReturnOnceThenWithdrawTest() { IWfActivity activityD = ReturnExecutorTestHelper.PrepareAndMoveToSpecialActivity(); int originalActivityCount = activityD.Process.Activities.Count; Assert.AreEqual("D", activityD.Descriptor.Key); activityD.Process.OutputMainStream(); activityD.Process.OutputEveryActivities(); ReturnExecutorTestHelper.ExecuteReturnOperation(activityD, "A"); Console.WriteLine("退件之后"); activityD.Process.OutputMainStream(); activityD.Process.OutputEveryActivities(); IWfProcess process = activityD.Process.WithdrawByExecutor(); Console.WriteLine("撤回之后"); process.OutputMainStream(); process.OutputEveryActivities(); Assert.AreEqual(originalActivityCount, process.Activities.Count, "撤回后与退件前的活动数一样"); Assert.AreEqual(originalActivityCount, process.Descriptor.Activities.Count, "撤回后与退件前的活动数一样"); }
public void ReturnTwiceTest() { IWfActivity activityD = ReturnExecutorTestHelper.PrepareAndMoveToSpecialActivity(); Assert.AreEqual("D", activityD.Descriptor.Key); activityD.Process.OutputMainStream(); activityD.Process.OutputEveryActivities(); //第一次退回 ReturnExecutorTestHelper.ExecuteReturnOperation(activityD, "A"); Console.WriteLine("第一次退回后"); activityD.Process.OutputMainStream(); activityD.Process.OutputEveryActivities(); activityD.Process.MoveToNextDefaultActivity(); //B1 activityD.Process.MoveToNextDefaultActivity(); //C1 activityD.Process.MoveToNextDefaultActivity(); //D1 Assert.AreEqual("D", activityD.Process.CurrentActivity.Descriptor.AssociatedActivityKey); //在B的出线C和E之间选择E activityD.Process.ApplicationRuntimeParameters["IsCLine"] = false; //第二次退回 ReturnExecutorTestHelper.ExecuteReturnOperation(activityD, "A"); Console.WriteLine("第二次退回后"); activityD.Process.OutputMainStream(); activityD.Process.OutputEveryActivities(); activityD.Process.ValidateMainStreamActivities("A", "B", "E", "D", "F"); }
public void ReturnTwiceThenWithdrawTwiceTest() { IWfActivity activityD = ReturnExecutorTestHelper.PrepareAndMoveToSpecialActivity(); int originalActivityCount = activityD.Process.Activities.Count; Assert.AreEqual("D", activityD.Descriptor.Key); activityD.Process.OutputMainStream(); activityD.Process.OutputEveryActivities(); //第一次退回 ReturnExecutorTestHelper.ExecuteReturnOperation(activityD, "A"); Console.WriteLine("第一次退回后"); activityD.Process.OutputMainStream(); activityD.Process.OutputEveryActivities(); activityD.Process.MoveToNextDefaultActivity(); //B1 activityD.Process.MoveToNextDefaultActivity(); //C1 activityD.Process.MoveToNextDefaultActivity(); //D1 Assert.AreEqual("D", activityD.Process.CurrentActivity.Descriptor.AssociatedActivityKey); //在B的出线C和E之间选择E activityD.Process.ApplicationRuntimeParameters["IsCLine"] = false; //第二次退回 ReturnExecutorTestHelper.ExecuteReturnOperation(activityD, "A"); Console.WriteLine("第二次退回后"); activityD.Process.OutputMainStream(); activityD.Process.OutputEveryActivities(); IWfProcess process = activityD.Process.WithdrawByExecutor(); Console.WriteLine("第一组撤回之后"); process.OutputMainStream(); process.OutputEveryActivities(); process = process.WithdrawByExecutor(); //C1; process = process.WithdrawByExecutor(); //B1 process = process.WithdrawByExecutor(); //A1 process = process.WithdrawByExecutor(); Console.WriteLine("第二组撤回之后"); process.OutputMainStream(); process.OutputEveryActivities(); Assert.AreEqual(originalActivityCount, process.Activities.Count, "撤回后与退件前的活动数一样"); Assert.AreEqual(originalActivityCount, process.Descriptor.Activities.Count, "撤回后与退件前的活动数一样"); }
public void ReturnOnceTest() { IWfActivity activityD = ReturnExecutorTestHelper.PrepareAndMoveToSpecialActivity(); Assert.AreEqual("D", activityD.Descriptor.Key); activityD.Process.OutputMainStream(); activityD.Process.OutputEveryActivities(); activityD.Process.ValidateMainStreamActivities("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); activityD.Process.OutputMainStream(); activityD.Process.OutputEveryActivities(); activityD.Process.ValidateMainStreamActivities("A", "B", "C", "D", "F"); }