コード例 #1
0
        public void TestAddition()
        {
            CalculatorProject.Calculator calculator = new CalculatorProject.Calculator();
            decimal result = calculator.Calculate(1.5m, 3.5m, CalculatorProject.CalculationType.ADDITION);

            Assert.Equal(5.0m, result);
        }
コード例 #2
0
        public void TestMultiplication()
        {
            CalculatorProject.Calculator calculator = new CalculatorProject.Calculator();
            decimal result = calculator.Calculate(1.5m, 3.5m, CalculatorProject.CalculationType.MULTIPLICATION);

            Assert.Equal(5.25m, result);
        }
コード例 #3
0
        public void TestSubtraction()
        {
            CalculatorProject.Calculator calculator = new CalculatorProject.Calculator();
            decimal result = calculator.Calculate(1.5m, 3.5m, CalculatorProject.CalculationType.SUBTRACTION);

            Assert.Equal(-2.0m, result);
        }
コード例 #4
0
        public void TestDivision()
        {
            decimal dividend = 10.0m;
            decimal divisor  = 2.0m;

            CalculatorProject.Calculator calculator = new CalculatorProject.Calculator();
            decimal result = calculator.Calculate(dividend, divisor, CalculatorProject.CalculationType.DIVISION);

            Assert.Equal(5.0m, result);
        }