Пример #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);
        }