Exemple #1
0
        public void TestMultiplyMethodWithTwoNegativeNumbers()
        {
            Calculator cal          = new Calculator();
            string     z            = "m";
            double     x            = -2.0;
            double     y            = -3.0;
            double     answer       = x * y;
            double     methodReturn = cal.DoOperation(x, y, z);

            Assert.AreEqual(answer, methodReturn);
        }
Exemple #2
0
        public void TestAddMethodWithTwoPositiveNumbers()
        {
            Calculator cal          = new Calculator();
            string     z            = "a";
            double     x            = 2.0;
            double     y            = 3.0;
            double     answer       = x + y;
            double     methodReturn = cal.DoOperation(x, y, z);

            Assert.AreEqual(answer, methodReturn);
        }
Exemple #3
0
        public void TestDivideMethodWithZeroAsDividendAndPositiveNumber()
        {
            Calculator cal          = new Calculator();
            string     z            = "d";
            double     x            = 0.0;
            double     y            = 3.0;
            double     answer       = x / y;
            double     methodReturn = cal.DoOperation(x, y, z);

            Assert.AreEqual(answer, methodReturn);
        }