Example #1
0
        private void AssertEval(string expr, double result)
        {
            ExpressionEvaluator ee     = new ExpressionEvaluator();
            ExpressionValue     actual = null;

            Assert.True(ee.TryEvaluate(expr, out actual));
            Assert.Equal(result, actual.ConvertToDouble());
        }
Example #2
0
        private static bool Equals(ExpressionValue left, ExpressionValue right)
        {
            if (right.Kind == ExpressionValueKind.Single || right.Kind == ExpressionValueKind.Double)
            {
                return(left.ConvertToDouble() == right.ConvertToDouble());
            }

            return(left.ConvertToLong() == right.ConvertToLong());
        }