コード例 #1
0
        public void ConditionEvaluatorNotEqualsWithSameFalse()
        {
            var evaluator = new ConditionEvaluator();
            var element   = GetXmlElement("<action condition='not equals' conditionArg1='a' conditionArg2='a' />");

            Assert.IsFalse(evaluator.ConditionIsTrueOrMissing(element));
        }
コード例 #2
0
        public void ConditionEvaluatorEqualsWithMixedCaseAndMatchingElementsTrue()
        {
            var evaluator = new ConditionEvaluator();
            var element   = GetXmlElement("<action condition='Equals' conditionArg1='a' conditionArg2='a' />");

            Assert.IsTrue(evaluator.ConditionIsTrueOrMissing(element));
        }
コード例 #3
0
        public void ConditionEvaluatorNoConditionReturnsTrue()
        {
            var evaluator = new ConditionEvaluator();
            var element   = GetXmlElement("<action />");

            Assert.IsTrue(evaluator.ConditionIsTrueOrMissing(element));
        }
コード例 #4
0
        public void ConditionEvaluator_EqualsWithDifferent_False()
        {
            var evaluator = new ConditionEvaluator();
            var element   = GetXmlElement("<action condition='equals' conditionArg1='a' conditionArg2='b' />");

            Assert.IsFalse(evaluator.ConditionIsTrueOrMissing(element));
        }
コード例 #5
0
        public void ConditionEvaluatorVariableInFirstElementDoesNotMatchFalse()
        {
            var variables = new Dictionary <string, string> {
                { "{variable}", "a" }
            };
            var evaluator = new ConditionEvaluator(variables);
            var element   = GetXmlElement("<action condition='equals' conditionArg1='{variable}' conditionArg2='b' />");

            Assert.IsFalse(evaluator.ConditionIsTrueOrMissing(element));
        }
コード例 #6
0
        public void ConditionEvaluatorVariableInBothElementsMatchTrue()
        {
            var variables = new Dictionary <string, string> {
                { "{variable1}", "a" }, { "{variable2}", "a" }
            };
            var evaluator = new ConditionEvaluator(variables);
            var element   = GetXmlElement("<action condition='equals' conditionArg1='{variable1}' conditionArg2='{variable2}' />");

            Assert.IsTrue(evaluator.ConditionIsTrueOrMissing(element));
        }
コード例 #7
0
        public void ConditionEvaluator_VariableInSecondMatchesElement_True()
        {
            var variables = new Dictionary <string, string> {
                { "{variable}", "a" }
            };
            var evaluator = new ConditionEvaluator(variables);
            var element   = GetXmlElement("<action condition='equals' conditionArg1='a' conditionArg2='{variable}' />");

            Assert.IsTrue(evaluator.ConditionIsTrueOrMissing(element));
        }