public void TestCreateActionRelationBuilder() { var factory = new ProcessBuilderFactory(); var builder = factory.CreateProcess(id: "p_001", name: "Renewal", description: "Policy Renewal"); ActionRelationBuilder actionRelationBuilder = new ActionRelationBuilder(builder); Assert.AreEqual(builder, actionRelationBuilder.Done()); }
public void TestActionRelationForSteps() { var factory = new ProcessBuilderFactory(); var builder = factory.CreateProcess(id: "p_001", name: "Renewal", description: "Policy Renewal"); ActionRelationBuilder actionRelationBuilder = new ActionRelationBuilder(builder); actionRelationBuilder.If("name").RequiredOnStep("step").Then("abc").RequiredOnStep("step1"); Assert.AreEqual("name", actionRelationBuilder.SourceActionId); Assert.AreEqual("step", actionRelationBuilder.SourceStepId); Assert.AreEqual("abc", actionRelationBuilder.TargetActionId); Assert.AreEqual("step1", actionRelationBuilder.TargetStepId); }
public void TestActionRelationCreateThroughProcessBuilder() { var factory = new ProcessBuilderFactory(); var builder = factory.CreateProcess(id: "p_001", name: "Renewal", description: "Policy Renewal"); builder.BuildActionRelations().If("name").RequiredOnStep("step").Then("abc").RequiredOnStep("step1") .Done() .Done(); Assert.IsNotNull(builder.ActionRelations); Assert.AreEqual(1, builder.ActionRelations.Count); ActionRelationBuilder actionRelationBuilder = builder.ActionRelations[0]; Assert.AreEqual("name", actionRelationBuilder.SourceActionId); Assert.AreEqual("step", actionRelationBuilder.SourceStepId); Assert.AreEqual("abc", actionRelationBuilder.TargetActionId); Assert.AreEqual("step1", actionRelationBuilder.TargetStepId); }