Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }