public bool GreaterBoolean(GreaterExpression node, List <object> parameters)
        {
            ExpressionNode lhs      = node.Children[0];
            ExpressionNode rhs      = node.Children[1];
            double         lhsValue = _interpreter.DispatchReal(lhs, parameters);
            double         rhsValue = _interpreter.DispatchReal(rhs, parameters);

            return(lhsValue > rhsValue);
        }
        public void LessBoolean_Real_CorrectValuesReturned(double lhsValue, double rhsValue, bool expected)
        {
            var lhs = Utilities.GetRealLitExpression();
            var rhs = Utilities.GetRealLitExpression();

            var expression             = new LessExpression(lhs, rhs, 0, 0);
            IInterpreterBoolean parent = Substitute.For <IInterpreterBoolean>();

            parent.DispatchReal(lhs, Arg.Any <List <object> >()).Returns(lhsValue);
            parent.DispatchReal(rhs, Arg.Any <List <object> >()).Returns(rhsValue);

            BooleanHelper booleanHelper = Utilities.GetBooleanHelper(parent);

            bool res = booleanHelper.LessBoolean(expression, new List <object>());

            Assert.AreEqual(expected, res);
        }
        public void LessBoolean_Real_CheckParametersPassedDown()
        {
            var lhs = Utilities.GetRealLitExpression();
            var rhs = Utilities.GetRealLitExpression();

            List <object>       parameters     = Utilities.GetParameterList(4);
            List <object>       expectedParams = parameters;
            var                 expression     = new LessExpression(lhs, rhs, 0, 0);
            IInterpreterBoolean parent         = Substitute.For <IInterpreterBoolean>();
            List <object>       lhsParams      = new List <object>();
            List <object>       rhsParams      = new List <object>();

            parent.DispatchReal(lhs, Arg.Do <List <object> >(x => lhsParams = x));
            parent.DispatchReal(rhs, Arg.Do <List <object> >(x => rhsParams = x));

            BooleanHelper booleanHelper = Utilities.GetBooleanHelper(parent);

            booleanHelper.LessBoolean(expression, parameters);

            Assert.AreEqual(expectedParams, lhsParams);
            Assert.AreEqual(expectedParams, rhsParams);
        }