public void ShouldReturnErrorWhenThereIsAnyInvalidChar() { Assert.Throws <ApplicationException>(() => ReversePolishNotationCalculator.Calculate("51,")); }
public void ShouldReturnErrorWhenThereAreNumbersWithoutBeenEvaluated() { Assert.Throws <ApplicationException>(() => ReversePolishNotationCalculator.Calculate("123+")); }
public void ShouldReturn1() { var actual = ReversePolishNotationCalculator.Calculate("51-2+5*33333++++/1-"); Assert.That(actual, Is.EqualTo(1)); }
public void ShouldReturnErrorWhenTheAmountOfOperatorsIsBiggerThanTheAmountOfNumbers() { Assert.Throws <ApplicationException>(() => ReversePolishNotationCalculator.Calculate("22+++")); }
public void ShouldReturn17() { var actual = ReversePolishNotationCalculator.Calculate("512+5*+3-"); Assert.That(actual, Is.EqualTo(17)); }