private ExprEqualsNode MakeNode(Object valueLeft, Type typeLeft, Object valueRight, Type typeRight, bool isNot) { ExprEqualsNode equalsNode = new ExprEqualsNodeImpl(isNot, false); equalsNode.AddChildNode(new SupportExprNode(valueLeft, typeLeft)); equalsNode.AddChildNode(new SupportExprNode(valueRight, typeRight)); SupportExprNodeUtil.Validate(equalsNode); return(equalsNode); }
private ExprMathNode MakeNode(Object valueLeft, Type typeLeft, Object valueRight, Type typeRight) { ExprMathNode mathNode = new ExprMathNode(MathArithTypeEnum.MULTIPLY, false, false); mathNode.AddChildNode(new SupportExprNode(valueLeft, typeLeft)); mathNode.AddChildNode(new SupportExprNode(valueRight, typeRight)); SupportExprNodeUtil.Validate(mathNode); return(mathNode); }
private ExprRelationalOpNode MakeNode(Object valueLeft, Type typeLeft, Object valueRight, Type typeRight) { ExprRelationalOpNode relOpNode = new ExprRelationalOpNodeImpl(RelationalOpEnum.GE); relOpNode.AddChildNode(new SupportExprNode(valueLeft, typeLeft)); relOpNode.AddChildNode(new SupportExprNode(valueRight, typeRight)); SupportExprNodeUtil.Validate(relOpNode); return(relOpNode); }
public void TestEvaluate() { notNode.AddChildNode(new SupportBoolExprNode(true)); SupportExprNodeUtil.Validate(container, notNode); Assert.IsFalse((bool)notNode.Evaluate(null, false, null)); notNode = new ExprNotNode(); notNode.AddChildNode(new SupportBoolExprNode(false)); SupportExprNodeUtil.Validate(container, notNode); Assert.IsTrue((bool)notNode.Evaluate(null, false, null)); }
public void TestEvaluate() { _notNode.AddChildNode(new SupportBoolExprNode(true)); SupportExprNodeUtil.Validate(_notNode); Assert.IsFalse(_notNode.Evaluate(new EvaluateParams(null, false, null)).AsBoolean()); _notNode = new ExprNotNode(); _notNode.AddChildNode(new SupportBoolExprNode(false)); SupportExprNodeUtil.Validate(_notNode); Assert.IsTrue(_notNode.Evaluate(new EvaluateParams(null, false, null)).AsBoolean()); }
public void TestEvaluate() { _concatNode.AddChildNode(new SupportExprNode("x")); _concatNode.AddChildNode(new SupportExprNode("y")); SupportExprNodeUtil.Validate(_concatNode); Assert.AreEqual(typeof(string), _concatNode.ExprEvaluator.ReturnType); Assert.AreEqual("xy", _concatNode.ExprEvaluator.Evaluate(EvaluateParams.Empty)); _concatNode.AddChildNode(new SupportExprNode("z")); SupportExprNodeUtil.Validate(_concatNode); Assert.AreEqual("xyz", _concatNode.ExprEvaluator.Evaluate(EvaluateParams.Empty)); }
public void TestEvaluate() { concatNode.AddChildNode(new SupportExprNode("x")); concatNode.AddChildNode(new SupportExprNode("y")); SupportExprNodeUtil.Validate(container, concatNode); Assert.AreEqual(typeof(string), concatNode.Forge.EvaluationType); Assert.AreEqual("xy", concatNode.Forge.ExprEvaluator.Evaluate(null, false, null)); concatNode.AddChildNode(new SupportExprNode("z")); SupportExprNodeUtil.Validate(container, concatNode); Assert.AreEqual("xyz", concatNode.Forge.ExprEvaluator.Evaluate(null, false, null)); }
public void TestEvaluate() { andNode.AddChildNode(new SupportBoolExprNode(true)); andNode.AddChildNode(new SupportBoolExprNode(true)); SupportExprNodeUtil.Validate(container, andNode); Assert.IsTrue((bool)andNode.Forge.ExprEvaluator.Evaluate(null, false, null)); andNode = new ExprAndNodeImpl(); andNode.AddChildNode(new SupportBoolExprNode(true)); andNode.AddChildNode(new SupportBoolExprNode(false)); SupportExprNodeUtil.Validate(container, andNode); Assert.IsFalse((bool)andNode.Forge.ExprEvaluator.Evaluate(null, false, null)); }
public void TestEvaluate() { orNode.AddChildNode(new SupportBoolExprNode(true)); orNode.AddChildNode(new SupportBoolExprNode(false)); SupportExprNodeUtil.Validate(container, orNode); Assert.IsTrue((bool)orNode.Forge.ExprEvaluator.Evaluate(null, false, null)); orNode = new ExprOrNode(); orNode.AddChildNode(new SupportBoolExprNode(false)); orNode.AddChildNode(new SupportBoolExprNode(false)); SupportExprNodeUtil.Validate(container, orNode); Assert.IsFalse((bool)orNode.Forge.ExprEvaluator.Evaluate(null, false, null)); orNode = new ExprOrNode(); orNode.AddChildNode(new SupportExprNode(null, typeof(bool?))); orNode.AddChildNode(new SupportExprNode(false)); SupportExprNodeUtil.Validate(container, orNode); Assert.IsNull(orNode.Forge.ExprEvaluator.Evaluate(null, false, null)); }