public void Add_GivenInputGreaterThan1000_ShouldNotAddToSumOfInputs(string input, int expectedSum) { //Arrange var sut = new StringCalculatorLogic(); //Act var actual = sut.Add(input); //Assert Assert.AreEqual(expectedSum, actual); }
public void Add_GivenInputWithNewLineAndDelimiter_ShouldReturnSum(string input, int expectedSum) { //Arrange var sut = new StringCalculatorLogic(); //Act var actual = sut.Add(input); //Assert Assert.AreEqual(expectedSum, actual); }
public void Add_GivenNegativeInput_ShouldThrowException(string input, string expectedMsg) { //Arrange var sut = new StringCalculatorLogic(); //Act var actual = Assert.Throws <Exception>(() => sut.Add(input)); //Assert Assert.AreEqual(expectedMsg, actual.Message); }
public void Add_GivenInvalidInput_ShouldReturnZero(string input) { //Arrange var expected = 0; var sut = new StringCalculatorLogic(); //Act var actual = sut.Add(input); //Assert Assert.AreEqual(expected, actual); }