コード例 #1
0
        public void TestMethod4()
        {
            string  x        = "min(56+5/4div2,)";
            string  expected = "#ERROR";
            Parser2 pasre    = new Parser2();
            Result  res      = pasre.Evaluate(x);
            string  actual   = res.GetValue();

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void TestMethod1()
        {
            string  x        = "34+2/(3*4-12)";
            string  expected = "#ERROR";
            Parser2 pasre    = new Parser2();
            Result  res      = pasre.Evaluate(x);
            string  actual   = res.GetValue();

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void TestMethod6()
        {
            string  x        = "3div2>3*1>4-1";
            string  expected = "False";
            Parser2 pasre    = new Parser2();
            Result  res      = pasre.Evaluate0(x);
            string  actual   = res.GetValue();

            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void TestMethod1()
        {
            string  x        = "min(2+5div2,4)=(45-37)/2";
            string  expected = "True";
            Parser2 pasre    = new Parser2();
            Result  res      = pasre.Evaluate0(x);
            string  actual   = res.GetValue();

            Assert.AreEqual(expected, actual);
        }
コード例 #5
0
        public void TestMethod4()
        {
            string  x        = "min(34,12+2)>max(32,12+2)";
            string  expected = "False";
            Parser2 pasre    = new Parser2();
            Result  res      = pasre.Evaluate0(x);
            string  actual   = res.GetValue();

            Assert.AreEqual(expected, actual);
        }
コード例 #6
0
        public void TestMethod1()
        {
            string  x        = "12+(2*3)-3";
            double  expected = 15;
            Parser2 parse    = new Parser2();
            Result  res      = parse.Evaluate(x);
            double  actual   = res.Value;

            Assert.AreEqual(actual, expected);
        }
コード例 #7
0
        public void TestMethod()
        {
            string  x        = "(48-3)mod(56-3)*4";
            double  expected = 180;
            Parser2 pasre    = new Parser2();
            Result  res      = pasre.Evaluate(x);
            double  actual   = res.Value;

            Assert.AreEqual(actual, expected);
        }
コード例 #8
0
        public void TestMethod4()
        {
            string  x        = "min(38+6/3*4+20,max(48-3*0,56-3*4))";
            double  expected = 48;
            Parser2 pasre    = new Parser2();
            Result  res      = pasre.Evaluate(x);
            double  actual   = res.Value;

            Assert.AreEqual(actual, expected);
        }
コード例 #9
0
        public void TestMethod2()
        {
            string  x        = "(12mod3/3)*2div3";
            double  expected = 0;
            Parser2 pasre    = new Parser2();
            Result  res      = pasre.Evaluate(x);
            double  actual   = res.Value;

            Assert.AreEqual(actual, expected);
        }