Example #1
0
        public void FunctionIteSimplificationElse()
        {
            var test = new ParserTester("if(-1, x, y)", null, new Var("y", 20), 20);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #2
0
        public void FunctionSngPositive()
        {
            var test = new ParserTester("sgn(2)", null, null, 1);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #3
0
        public void FunctionSngZero()
        {
            var test = new ParserTester("sgn(0)", null, null, 0);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #4
0
        public void FunctionRoundPositiveMidpointEven()
        {
            var test = new ParserTester("round(4.5)", null, null, 5);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #5
0
        public void FunctionRoundVar()
        {
            var test = new ParserTester("round(x)", null, new Var("x", 5.7), 6);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #6
0
        public void FunctionMin2ParamsVar()
        {
            var test = new ParserTester("min(x, y)", null, new Var("x", 3).And("y", 5), 3);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #7
0
        public void FunctionRoundNegativeMidpointOdd()
        {
            var test = new ParserTester("round(-3.5)", null, null, -4);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #8
0
        public void FunctionAbsPositive()
        {
            var test = new ParserTester("abs(5.2)", null, null, 5.2);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #9
0
        public void FunctionCaseTwoSecond()
        {
            var test = new ParserTester("case(-1, 1)", null, null, 1);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #10
0
        public void FunctionCaseOneTrue()
        {
            var test = new ParserTester("case(0)", null, null, 0);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #11
0
        public void FunctionCaseTwoFirst()
        {
            var test = new ParserTester("case(1, 1)", null, null, 0);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #12
0
        public void FunctionIteZero()
        {
            var test = new ParserTester("if(0, 10, 20)", null, null, 10);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #13
0
        public void FunctionIteThenVar()
        {
            var test = new ParserTester("if(c, x, y)", null, new Var("c", 1).And("x", 10).And("y", 20), 10);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #14
0
        public void FunctionIteSimplificationThen()
        {
            var test = new ParserTester("if(1, x, y)", null, new Var("x", 10), 10);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #15
0
        public void FunctionMin2Params()
        {
            var test = new ParserTester("min(2, 5)", null, null, 2);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #16
0
        public void FunctionCaseTwoNone()
        {
            var test = new ParserTester("case(-1, -1)", null, null, 2);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #17
0
        public void FunctionAbsVar()
        {
            var test = new ParserTester("abs(x)", null, new Var("x", -1), 1);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #18
0
        public void FunctionLimitGreater()
        {
            var test = new ParserTester("limit(10, 1, 3)", null, null, 3);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #19
0
        public void FunctionMin5Params()
        {
            var test = new ParserTester("min(-2, 2, -3, 5, 1.5)", null, null, -3);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #20
0
        public void FunctionLimitInside()
        {
            var test = new ParserTester("limit(2, 1, 3)", null, null, 2);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #21
0
        public void FunctionRoundNegativeUp()
        {
            var test = new ParserTester("round(-2.1)", null, null, -2);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #22
0
        public void FunctionLimitLower()
        {
            var test = new ParserTester("limit(-2, 1, 3)", null, null, 1);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #23
0
        public void FunctionRoundPositiveUp()
        {
            var test = new ParserTester("round(5.7)", null, null, 6);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #24
0
        public void FunctionLimitVar()
        {
            var test = new ParserTester("limit(x, a, b)", null, new Var("x", 10).And("a", 1).And("b", 3), 3);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #25
0
        public void FunctionSngNegative()
        {
            var test = new ParserTester("sgn(-4)", null, null, -1);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #26
0
        public void FunctionMax2ParamsConst()
        {
            var test = new ParserTester("max(2, 5)", null, null, 5);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #27
0
        public void FunctionSngVar()
        {
            var test = new ParserTester("sgn(x)", null, new Var("x", 5.7), 1);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #28
0
        public void FunctionMax5Params()
        {
            var test = new ParserTester("max(-2, 10.1, -3, 5, 1)", null, null, 10.1);

            Assert.IsTrue(test.IsOK, test.Message);
        }
Example #29
0
        public void FunctionTruncInteger()
        {
            var test = new ParserTester("Trunc(4)", null, null, 4);

            Assert.IsTrue(test.IsOK, test.Message);
        }
        public void GreaterEqualUnicodeFalse()
        {
            var test = new ParserTester("9 ≥ 10", null, null, -1);

            Assert.IsTrue(test.IsOK, test.Message);
        }