public void Calculate_SimpleEquation1() { var equation = "(17+10)/2"; var answer = _calculator.Calculate(equation); answer.Should().Be(13); }
public void Calculate_NoBrackets_ReturnsDirectCalculation() { var equation = "1"; StringRange deepestNest = null; var section = "1"; A.CallTo(() => _nestingIdentifier.FindDeepestNest(equation)).Returns(deepestNest); A.CallTo(() => _mathsResolver.ResolveSection(section)).Returns("1"); var response = _calculator.Calculate(equation); response.Should().Be(1); A.CallTo(() => _nestingIdentifier.FindDeepestNest(equation)).MustHaveHappened(); A.CallTo(() => _mathsResolver.ResolveSection(section)).MustHaveHappened(); }