예제 #1
0
        public void TestMultiplyeMethodWithTwoPostiveNumber()
        {
            CalculatorLibrary1.Calculator cal = new CalculatorLibrary1.Calculator();
            string a      = "*";
            double x      = 1.0;
            double y      = 3.0;
            double awnser = x * y;
            double actual = cal.DoOperation(x, y, a);

            Assert.AreEqual(awnser, actual);
        }
예제 #2
0
        public void TestAddMethodWithTwoNegtiveNumber()
        {
            CalculatorLibrary1.Calculator cal = new CalculatorLibrary1.Calculator();
            string a      = "+";
            double x      = -1.0;
            double y      = -3.0;
            double awnser = x + y;
            double actual = cal.DoOperation(x, y, a);

            Assert.AreEqual(awnser, actual);
        }
예제 #3
0
        public void TestSubtractMethodWithonePostiveNumber()
        {
            CalculatorLibrary1.Calculator cal = new CalculatorLibrary1.Calculator();
            string a      = "-";
            double x      = -1.0;
            double y      = 2.0;
            double awnser = x - y;
            double actual = cal.DoOperation(x, y, a);

            Assert.AreEqual(awnser, actual);
        }
예제 #4
0
        public void TestDivideMethodWithoneNegtivetiveNumber()
        {
            CalculatorLibrary1.Calculator cal = new CalculatorLibrary1.Calculator();
            string a      = "/";
            double x      = -4.0;
            double y      = 2.0;
            double awnser = x / y;
            double actual = cal.DoOperation(x, y, a);

            Assert.AreEqual(awnser, actual);
        }