示例#1
0
            public void evalutes_the_conditions()
            {
                ActEntryGathererScenario.Create(_ =>
                {
                    _.UseFile("nested.history.config");
                    _.TheWorkflowObjectIs(new WorkflowObject
                    {
                        Type    = "case",
                        Id      = "1",
                        IsChild = true
                    });
                    _.MergeHistory(true);
                }).ShouldHaveTheSameElementsAs(100, 200, 300, 101, 202, 303);

                ActEntryGathererScenario.Create(_ =>
                {
                    _.UseFile("nested.history.config");
                    _.TheWorkflowObjectIs(new WorkflowObject
                    {
                        Type    = "case",
                        Id      = "1",
                        IsChild = false
                    });
                    _.MergeHistory(true);
                }).ShouldHaveTheSameElementsAs(400, 500, 401);
            }
示例#2
0
            public void it_filters_by_user()
            {
                ActEntryGathererScenario.Create(_ =>
                {
                    _.UseFile("privilege.history.config");
                    _.TheWorkflowObjectIs(new WorkflowObject
                    {
                        Type    = "case",
                        Id      = "1",
                        IsChild = false
                    });
                    _.TheUserHasPrivilege("a");
                }).ShouldHaveTheSameElementsAs(1001, 1003);

                ActEntryGathererScenario.Create(_ =>
                {
                    _.UseFile("privilege.history.config");
                    _.TheWorkflowObjectIs(new WorkflowObject
                    {
                        Type    = "case",
                        Id      = "1",
                        IsChild = false
                    });
                    _.TheUserHasPrivilege("b");
                }).ShouldHaveTheSameElementsAs(1002, 1003);
            }
示例#3
0
            public void it_filters_the_act_entries()
            {
                ActEntryTest.Value = true;
                ActEntryConditionRegistry.WithCondition <ActEntryTest>(() =>
                {
                    ActEntryGathererScenario.Create(_ =>
                    {
                        _.UseFile("custom-condition.history.config");
                        _.TheWorkflowObjectIs(new WorkflowObject
                        {
                            Type    = "case",
                            Id      = "1",
                            IsChild = false
                        });
                    }).ShouldHaveTheSameElementsAs(101, 202, 303);
                });

                ActEntryTest.Value = false;
                ActEntryConditionRegistry.WithCondition <ActEntryTest>(() =>
                {
                    ActEntryGathererScenario.Create(_ =>
                    {
                        _.UseFile("custom-condition.history.config");
                        _.TheWorkflowObjectIs(new WorkflowObject
                        {
                            Type    = "case",
                            Id      = "1",
                            IsChild = false
                        });
                    }).ShouldBeEmpty();
                });
            }
示例#4
0
 public void and_workflow_object_is_not_child()
 {
     ActEntryGathererScenario.Create(_ =>
     {
         _.UseFile("is-child.history.config");
         _.TheWorkflowObjectIs(new WorkflowObject
         {
             Type    = "case",
             Id      = "1",
             IsChild = false
         });
     }).ShouldHaveTheSameElementsAs(400, 500);
 }
示例#5
0
            public static int[] Create(Action <ActEntryGathererScenarioExpression> configure)
            {
                ActEntryGathererScenario actEntryScenario = null;
                var scenario = HistoryMapParsingScenario.Create(_ =>
                {
                    var actEntryExpression = new ActEntryGathererScenarioExpression(_);
                    configure(actEntryExpression);

                    actEntryScenario = actEntryExpression.As <IScenarioBuilder>().Create();
                });

                return(actEntryScenario.ResolveActCodes(scenario));
            }
示例#6
0
 public void and_setting_is_false()
 {
     ActEntryGathererScenario.Create(_ =>
     {
         _.UseFile("merge.history.config");
         _.TheWorkflowObjectIs(new WorkflowObject
         {
             Type    = "case",
             Id      = "1",
             IsChild = false
         });
         _.MergeHistory(false);
     }).ShouldHaveTheSameElementsAs(404, 505);
 }
示例#7
0
 public void and_the_request_is_not_verbose()
 {
     ActEntryGathererScenario.Create(_ =>
     {
         _.UseFile("verbose.history.config");
         _.TheWorkflowObjectIs(new WorkflowObject
         {
             Type    = "case",
             Id      = "1",
             IsChild = false
         });
         _.ShowAll(false);
     }).ShouldHaveTheSameElementsAs(2000, 2003);
 }