Beispiel #1
0
        public void testInvalidInput2()
        {
            Calculator.Request req = new Calculator.Request();
            bool valid             = req.setValue("4 x 0 +");

            Assert.AreEqual(false, valid);
        }
Beispiel #2
0
        public void testTime()
        {
            Calculator.Request req = new Calculator.Request();
            req.setValue("4 * 5");
            double ans = req.getResult();

            Assert.AreEqual(20, ans);
        }
Beispiel #3
0
        public void testDivide1()
        {
            Calculator.Request req = new Calculator.Request();
            req.setValue("4 / 5");
            double ans = req.getResult();

            Assert.AreEqual(0.8, ans);
        }
Beispiel #4
0
        public void testMinus()
        {
            Calculator.Request req = new Calculator.Request();
            req.setValue("4 - 5");
            double ans = req.getResult();

            Assert.AreEqual(-1, ans);
        }
Beispiel #5
0
        public void testInvalidInput3()
        {
            Calculator.Request req = new Calculator.Request();
            req.setValue("4 x +");
            double ans   = req.getResult();
            bool   valid = req.getValid();

            Assert.AreEqual(0, ans);
            Assert.AreEqual(false, valid);
        }