本文整理汇总了C#中Procedure.GetWorkflowHistory方法的典型用法代码示例。如果您正苦于以下问题:C# Procedure.GetWorkflowHistory方法的具体用法?C# Procedure.GetWorkflowHistory怎么用?C# Procedure.GetWorkflowHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Procedure
的用法示例。
在下文中一共展示了Procedure.GetWorkflowHistory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_GetWorkflowHistory_Empty
public void Test_GetWorkflowHistory_Empty()
{
var procedure = new Procedure();
Assert.IsEmpty(procedure.GetWorkflowHistory());
}
示例2: Test_GetWorkflowHistory_UnrelatedSteps
public void Test_GetWorkflowHistory_UnrelatedSteps()
{
// This "tree" doesn't have the right children of each pair in the third level
// Due to the abscence of relating these steps
var pRoot = new Procedure(); // associative Procedure to first level
var ps1 = new ConcreteProcedureStep(pRoot);
var p1 = new Procedure(); // associative Procedure to left branch of second level
var ps11 = new ConcreteProcedureStep(p1);
var p11 = new Procedure(); // associative Procedure to leftmost branch of third level
var ps111 = new ConcreteProcedureStep(p11);
var ps112 = new ConcreteProcedureStep(p11); // is not related to ps111
ps11.LinkTo(ps111); // link adjacent levels
var ps12 = new ConcreteProcedureStep(p1);
var p12 = new Procedure(); // associative Procedure to second leftmost branch of third level
var ps121 = new ConcreteProcedureStep(p12);
var ps122 = new ConcreteProcedureStep(p12); // is not related to ps121
ps12.LinkTo(ps121); // link adjacent levels
ps11.AddRelatedStep(ps12); // relate steps of p1
ps1.LinkTo(ps11); // link adjacent levels
var ps2 = new ConcreteProcedureStep(pRoot);
var p2 = new Procedure(); // associative Procedure to right branch of second level
var ps21 = new ConcreteProcedureStep(p2);
var p21 = new Procedure(); // associative Procedure to second rightmost branch of third level
var ps211 = new ConcreteProcedureStep(p21);
var ps212 = new ConcreteProcedureStep(p21); // is not related to ps211
ps21.LinkTo(ps211); // link adjacent levels
var ps22 = new ConcreteProcedureStep(p2);
var p22 = new Procedure(); // associative Procedure to rightmost branch of third level
var ps221 = new ConcreteProcedureStep(p22);
var ps222 = new ConcreteProcedureStep(p22); // is not related to ps221
ps22.LinkTo(ps221); // link adjacent levels
ps21.AddRelatedStep(ps22); // relate steps of p2
ps2.LinkTo(ps21); // link adjacent levels
Assert.AreEqual(10, pRoot.GetWorkflowHistory().Count);
// Assert all items in "tree" are present in Workflow history... except these ones:
Assert.IsFalse(pRoot.GetWorkflowHistory().Contains(ps112));
Assert.IsFalse(pRoot.GetWorkflowHistory().Contains(ps122));
Assert.IsFalse(pRoot.GetWorkflowHistory().Contains(ps212));
Assert.IsFalse(pRoot.GetWorkflowHistory().Contains(ps222));
}
示例3: Test_GetWorkflowHistory_TwoLevel
public void Test_GetWorkflowHistory_TwoLevel()
{
// Testing an ideal 6 item Workflow history "tree"
var pRoot = new Procedure(); // associative Procedure to first level
var ps1 = new ConcreteProcedureStep(pRoot); // First level
var p1 = new Procedure(); // associative Procedure to left branch of second level
var ps11 = new ConcreteProcedureStep(p1); // Second level, left branch
var ps12 = new ConcreteProcedureStep(p1); // Second level, left branch
ps11.AddRelatedStep(ps12); // Relate children
ps1.LinkTo(ps11); // Link adjacent levels
var ps2 = new ConcreteProcedureStep(pRoot); // First level
var p2 = new Procedure(); // associative Procedure to right branch of second level
var ps21 = new ConcreteProcedureStep(p2); // Second level, right branch
var ps22 = new ConcreteProcedureStep(p2); // Second level, right branch
ps21.AddRelatedStep(ps22); // Relate children
ps2.LinkTo(ps21); // Link adjacent levels
Assert.AreEqual(6, pRoot.GetWorkflowHistory().Count); // Assert all items in "tree" are present in Workflow history
}
示例4: Test_GetWorkflowHistory_ThreeLevel
public void Test_GetWorkflowHistory_ThreeLevel()
{
var pRoot = new Procedure(); // associative Procedure to first level
var ps1 = new ConcreteProcedureStep(pRoot);
var p1 = new Procedure(); // associative Procedure to left branch of second level
var ps11 = new ConcreteProcedureStep(p1);
var p11 = new Procedure(); // associative Procedure to leftmost branch of third level
var ps111 = new ConcreteProcedureStep(p11);
var ps112 = new ConcreteProcedureStep(p11);
ps111.AddRelatedStep(ps112); // relate steps of p11
ps11.LinkTo(ps111); // link adjacent levels
var ps12 = new ConcreteProcedureStep(p1);
var p12 = new Procedure(); // associative Procedure to second leftmost branch of third level
var ps121 = new ConcreteProcedureStep(p12);
var ps122 = new ConcreteProcedureStep(p12);
ps121.AddRelatedStep(ps122); // relate steps of p12
ps12.LinkTo(ps121); // link adjacent levels
ps11.AddRelatedStep(ps12); // relate steps of p1
ps1.LinkTo(ps11); // link adjacent levels
var ps2 = new ConcreteProcedureStep(pRoot);
var p2 = new Procedure(); // associative Procedure to right branch of second level
var ps21 = new ConcreteProcedureStep(p2);
var p21 = new Procedure(); // associative Procedure to second rightmost branch of third level
var ps211 = new ConcreteProcedureStep(p21);
var ps212 = new ConcreteProcedureStep(p21);
ps211.AddRelatedStep(ps212); // relate steps of p21
ps21.LinkTo(ps211); // link adjacent levels
var ps22 = new ConcreteProcedureStep(p2);
var p22 = new Procedure(); // associative Procedure to rightmost branch of third level
var ps221 = new ConcreteProcedureStep(p22);
var ps222 = new ConcreteProcedureStep(p22);
ps221.AddRelatedStep(ps222); // relate steps of p22
ps22.LinkTo(ps221); // link adjacent levels
ps21.AddRelatedStep(ps22); // relate steps of p2
ps2.LinkTo(ps21); // link adjacent levels
Assert.AreEqual(14, pRoot.GetWorkflowHistory().Count); // Assert all items in "tree" are present in Workflow history
}
示例5: Test_GetWorkflowHistory_OneLevel
public void Test_GetWorkflowHistory_OneLevel()
{
var procedure = new Procedure();
var ps1 = new DocumentationProcedureStep(procedure);
var ps2 = new DocumentationProcedureStep(procedure);
Assert.AreEqual(2, procedure.GetWorkflowHistory().Count);
}