public string Post([FromForm] decimal leftNumber, [FromForm] decimal rightNumber) { SimpleCalc calc = new SimpleCalc(); decimal result; result = calc.additionFunc(leftNumber, rightNumber); return(result.ToString()); }
public void SimpleCalc_Add_TwoPositiveNumbers() { decimal num1 = 1; decimal num2 = 2; decimal expected = num1 + num2; SimpleCalc calc = new SimpleCalc(); decimal result = calc.additionFunc(num1, num2); Assert.AreEqual(expected, result); }
public void SimpleCalc_Add_ZeroFirstNumAndNegativeSecondNum() { decimal num1 = 0; decimal num2 = -2; decimal expected = num1 + num2; SimpleCalc calc = new SimpleCalc(); decimal result = calc.additionFunc(num1, num2); Assert.AreEqual(expected, result); }
public void SimpleCalc_Add_TwoNegativeDecimalNumbers() { decimal num1 = -1.1M; decimal num2 = -2.2M; decimal expected = num1 + num2; SimpleCalc calc = new SimpleCalc(); decimal result = calc.additionFunc(num1, num2); Assert.AreEqual(expected, result); }