public void CalcRepo_DivideTwoNumbers_ShouldReturnCorrectDouble() { // Arrange CalculatorRepository repo = new CalculatorRepository(); // Act double expected = repo.Divide(12.5, 5); double actual = 2.5; // Assert Assert.AreEqual(expected, actual); }
public void DivideByZero() { int firstValue = 4; int secondValue = 0; CalculatorRepository op = new CalculatorRepository(); Assert.Throws<DivideByZeroException>(() => op.Divide(firstValue, secondValue)); }
private void Divide() { Console.Write("Enter the first number: "); double firstNum = ParseInput(); Console.Write("Enter the number you would like to divide the first by: "); double secondNum = ParseInput(); double quotient = _calculator.Divide(firstNum, secondNum); Console.WriteLine($"{firstNum} / {secondNum} = {quotient}"); }
public void Divide() { int firstValue = 4; int secondValue = 2; CalculatorRepository op = new CalculatorRepository(); var result = op.Divide(firstValue, secondValue); Assert.Equal(2, result); }