public void IgnoreValuesGreaterThan1000ReturnsSum() { //Arrange Calculator calc = new Calculator(); string input = "10,20,\n30,1000,1001"; //Act double answer = calc.Sum(input); //Assert Assert.AreEqual(1060.0, answer, 0.0001); }
public void EmptyStringReturnsSumZero() { //Arrange Calculator calc = new Calculator(); string input = ""; //Act double answer = calc.Sum(input); //Assert Assert.AreEqual(0.0, answer,0.0001); }
public void NegativeNumbersCastsException() { //Arrange Calculator calc = new Calculator(); string input = "10\n-20,30"; //Act double answer = calc.Sum(input); }
public void TwoValuesWithNewLineStringReturnsSum() { //Arrange Calculator calc = new Calculator(); string input = "10\n20"; //Act double answer = calc.Sum(input); //Assert Assert.AreEqual(30.0, answer, 0.0001); }
public void SingleValueStringReturnsValue() { //Arrange Calculator calc = new Calculator(); string input = "10"; //Act double answer = calc.Sum(input); //Assert Assert.AreEqual(10.0, answer, 0.0001); }