コード例 #1
0
        public void CalculateTest()
        {
            StringBuilder sb = new StringBuilder("5+6/2*3");
            StringBuilder sd = new StringBuilder("7*5+8/4");
            Compute       cm = new Compute(sb);

            cm.DoTrans();
            Compute cn = new Compute(sd);

            cn.DoTrans();
            double a = cm.Calculate();
            double b = cn.Calculate();

            Assert.AreEqual(a, 14);
            Assert.AreEqual(b, 37);
        }