Exemple #1
0
        public void FloatAddition()
        {
            calculator cal     = new calculator();
            double     fresult = cal.SumFloat(10.3, 10.4);

            Assert.AreEqual(20.7, fresult);
        }
Exemple #2
0
        public void sumTest()
        {
            calculator cal    = new calculator();
            int        result = cal.Sum(50, 70);

            Assert.AreEqual(120, result);
        }
Exemple #3
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 #4
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 #5
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);
        }