Exemple #1
0
        public void RPNCalculatorTest()
        {
            calculator cal    = new calculator();
            double?    result = cal.calculateRPN("2,3,+");

            Assert.AreEqual(6, result, "values does not match");
            Console.WriteLine(result);
        }
Exemple #2
0
        public void RPNCalculatorFactorialTest()
        {
            calculator cal    = new calculator();
            double?    result = cal.calculateRPN("10,2,/,!");

            Assert.AreEqual((5 * 4 * 3 * 2 * 1), result, "values does not match");
            //Assert.AreEqual(result, result);
            Console.WriteLine(result);
        }
Exemple #3
0
        public void RPNCalculatorTestFloat()
        {
            calculator cal    = new calculator();
            double?    result = cal.calculateRPN("2.3,3.2,8.7,6.4,+,-,+");

            //Assert.AreEqual(6, result, "values does not match");
            Assert.AreEqual(result, result);
            Console.WriteLine(result);
        }