public ExprMinMaxRowNodeForge( ExprMinMaxRowNode parent, Type resultType) { ForgeRenderable = parent; EvaluationType = resultType; }
public void TestEvaluate() { minMaxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MAX); SetupNode(minMaxNode, 10, 1.5, null); Assert.AreEqual(10d, minMaxNode.Forge.ExprEvaluator.Evaluate(null, false, null)); minMaxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MAX); SetupNode(minMaxNode, 1, 1.5, null); Assert.AreEqual(1.5d, minMaxNode.Forge.ExprEvaluator.Evaluate(null, false, null)); minMaxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MIN); SetupNode(minMaxNode, 1, 1.5, null); Assert.AreEqual(1d, minMaxNode.Forge.ExprEvaluator.Evaluate(null, false, null)); minMaxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MAX); SetupNode(minMaxNode, 1, 1.5, 2.0f); Assert.AreEqual(2.0d, minMaxNode.Forge.ExprEvaluator.Evaluate(null, false, null)); minMaxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MIN); SetupNode(minMaxNode, 6, 3.5, 2.0f); Assert.AreEqual(2.0d, minMaxNode.Forge.ExprEvaluator.Evaluate(null, false, null)); minMaxNode = MakeNode(null, typeof(int?), 5, typeof(int?), 6, typeof(int?)); Assert.IsNull(minMaxNode.Forge.ExprEvaluator.Evaluate(null, false, null)); minMaxNode = MakeNode(7, typeof(int?), null, typeof(int?), 6, typeof(int?)); Assert.IsNull(minMaxNode.Forge.ExprEvaluator.Evaluate(null, false, null)); minMaxNode = MakeNode(3, typeof(int?), 5, typeof(int?), null, typeof(int?)); Assert.IsNull(minMaxNode.Forge.ExprEvaluator.Evaluate(null, false, null)); minMaxNode = MakeNode(null, typeof(int?), null, typeof(int?), null, typeof(int?)); Assert.IsNull(minMaxNode.Forge.ExprEvaluator.Evaluate(null, false, null)); }
private void SetupNode( ExprMinMaxRowNode nodeMin, int intValue, double doubleValue, float?floatValue) { nodeMin.AddChildNode(new SupportExprNode(intValue)); nodeMin.AddChildNode(new SupportExprNode(doubleValue)); if (floatValue != null) { nodeMin.AddChildNode(new SupportExprNode(floatValue)); } nodeMin.Validate(SupportExprValidationContextFactory.MakeEmpty(container)); }
private ExprMinMaxRowNode MakeNode( object valueOne, Type typeOne, object valueTwo, Type typeTwo, object valueThree, Type typeThree) { var maxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MAX); maxNode.AddChildNode(new SupportExprNode(valueOne, typeOne)); maxNode.AddChildNode(new SupportExprNode(valueTwo, typeTwo)); maxNode.AddChildNode(new SupportExprNode(valueThree, typeThree)); maxNode.Validate(SupportExprValidationContextFactory.MakeEmpty(container)); return(maxNode); }
public void SetUp() { minMaxNode = new ExprMinMaxRowNode(MinMaxTypeEnum.MAX); }