Example #1
0
        public string Post([FromForm] decimal leftNumber, [FromForm] decimal rightNumber)
        {
            SimpleCalc calc = new SimpleCalc();
            decimal    result;

            result = calc.multiplicationFunc(leftNumber, rightNumber);
            return(result.ToString());
        }
        public void SimpleCalc_Multiply_TwoNegativeDecimalNumbers()
        {
            decimal num1     = -1.1M;
            decimal num2     = -2.2M;
            decimal expected = num1 * num2;

            SimpleCalc calc   = new SimpleCalc();
            decimal    result = calc.multiplicationFunc(num1, num2);

            Assert.AreEqual(expected, result);
        }
        public void SimpleCalc_Multiply_NegativeFirstNumAndZeroSecondNum()
        {
            decimal num1     = -1;
            decimal num2     = 0;
            decimal expected = num1 * num2;

            SimpleCalc calc   = new SimpleCalc();
            decimal    result = calc.multiplicationFunc(num1, num2);

            Assert.AreEqual(expected, result);
        }
        public void SimpleCalc_Multiply_TwoPositiveNumbers()
        {
            decimal num1     = 1;
            decimal num2     = 2;
            decimal expected = num1 * num2;

            SimpleCalc calc   = new SimpleCalc();
            decimal    result = calc.multiplicationFunc(num1, num2);

            Assert.AreEqual(expected, result);
        }