Ejemplo n.º 1
0
        public void CheckAlwaysCondition()
        {
            var step = new StepConfig()
            {
                Step = new EmptyStep(), Condition = new ExecutionCondition {
                    Always = true
                }
            };

            Assert.AreEqual(true, ExecutionConditionChecker.CheckCondition(step.Condition, new ProcessorInfo(), 0));
        }
Ejemplo n.º 2
0
        public void CheckPreviousSteps()
        {
            var info = new ProcessorInfo()
            {
                Steps = new List <StepConfig>()
                {
                    new StepConfig()
                    {
                        Step = new EmptyStep(), Condition = new ExecutionCondition {
                            Always = true
                        }
                    },
                    new StepConfig()
                    {
                        Step = new EmptyStep(), Condition = new ExecutionCondition {
                            Always = true
                        }
                    },
                    new StepConfig()
                    {
                        Step = new EmptyStep(), Condition = new ExecutionCondition {
                            Always = true
                        }
                    },
                    new StepConfig()
                    {
                        Step = new EmptyStep(), Condition = new ExecutionCondition {
                            Always = true
                        }
                    },
                    new StepConfig()
                    {
                        Step = new EmptyStep(), Condition = new ExecutionCondition {
                            StepsSucceded = new [] { 0, 1, 2, 3 }
                        }
                    }
                },
                StepStatus = new List <Status>()
                {
                    Status.Successful,
                    Status.Successful,
                    Status.Successful,
                    Status.Successful,
                    Status.Waiting
                }
            };

            Assert.AreEqual(true, ExecutionConditionChecker.CheckCondition(info.Steps[4].Condition, info, 4));
        }
Ejemplo n.º 3
0
        public void CheckPreviousCondition()
        {
            var step = new StepConfig()
            {
                Step = new EmptyStep(), Condition = new ExecutionCondition {
                    IfPreviousSucceded = true
                }
            };
            var info = new ProcessorInfo()
            {
                Steps = new List <StepConfig>()
                {
                    step, step
                }, StepStatus = new List <Status>()
                {
                    Status.Successful, Status.Waiting
                }
            };

            Assert.AreEqual(true, ExecutionConditionChecker.CheckCondition(step.Condition, info, 1));
        }