public void ConditionEvaluatorNotEqualsWithSameFalse() { var evaluator = new ConditionEvaluator(); var element = GetXmlElement("<action condition='not equals' conditionArg1='a' conditionArg2='a' />"); Assert.IsFalse(evaluator.ConditionIsTrueOrMissing(element)); }
public void ConditionEvaluatorEqualsWithMixedCaseAndMatchingElementsTrue() { var evaluator = new ConditionEvaluator(); var element = GetXmlElement("<action condition='Equals' conditionArg1='a' conditionArg2='a' />"); Assert.IsTrue(evaluator.ConditionIsTrueOrMissing(element)); }
public void ConditionEvaluatorNoConditionReturnsTrue() { var evaluator = new ConditionEvaluator(); var element = GetXmlElement("<action />"); Assert.IsTrue(evaluator.ConditionIsTrueOrMissing(element)); }
public void ConditionEvaluator_EqualsWithDifferent_False() { var evaluator = new ConditionEvaluator(); var element = GetXmlElement("<action condition='equals' conditionArg1='a' conditionArg2='b' />"); Assert.IsFalse(evaluator.ConditionIsTrueOrMissing(element)); }
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)); }
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)); }
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)); }