Exemple #1
0
        public void TestMul(double a, double b, double res)
        {
            IRPNCalculator c = new RPNCalculator();

            Assert.True(c.Size() == 0);
            c.Push(a);
            c.Push(b);
            Assert.True(c.Size() == 2 && c.Top() == 5);
            c.Multiply();
            Assert.True(c.Size() == 1 && c.Top() == res);
        }
Exemple #2
0
        public void TestMoreMaths(double a, double b, double c, double res)
        {
            IRPNCalculator cal = new RPNCalculator();

            Assert.True(cal.Size() == 0);
            cal.Push(a);
            cal.Push(b);
            cal.Push(c);
            Assert.True(cal.Size() == 3 && cal.Top() == 5);
            cal.Add();
            cal.Multiply();
            Assert.True(cal.Top() == res && cal.Size() == 1);
        }