public void FormatExceptionTest(string invalidInput, string negativeNumbers) { // Arrange var calculatorAddService = new CalculatorAddService(); // Act var mockException = Assert.Throws <FormatException>(() => calculatorAddService.Execute(invalidInput)); // Assert Assert.Equal("Negative numbers are invalid: " + negativeNumbers, mockException.Message); }
public void CalculatorAddNegativeTest(string inputString, string expectedOutput) { // Arrange var calculatorAddService = new CalculatorAddService(); // Act - pass in optional parameters for negatives and max value var actualOutput = calculatorAddService.Execute(inputString, true, 5000); // Assert Assert.Equal(expectedOutput, actualOutput); }
public void CalculatorAddTest(string inputString, string expectedOutput) { // Arrange var calculatorAddService = new CalculatorAddService(); // Act var actualOutput = calculatorAddService.Execute(inputString); // Assert Assert.Equal(expectedOutput, actualOutput); }