static void Main() { Calculator calc = new Calculator(); Console.WriteLine(calc.Calculate("((2+7)/3+(14-3)*4)/2")); Console.WriteLine(calc.Calculate("((2+7)/3+(14-3)*4)")); Console.ReadLine(); }
public void Calculate_ValidOperationString_ReturnsAnswer2() { var calc = new Calculator(); var result = calc.Calculate("((2+7)/3+(14-3)*4)/2"); var expectation = 23.5; Assert.AreEqual(expectation, result); }
public void Calculate_ValidOperationString_ReturnsAnswer1() { var calc = new Calculator(); var result = calc.Calculate("3+2"); var expectation = 5; Assert.AreEqual(expectation, result); }
public void Calculate_EmptyString_ThrowsEmptyStringException() { var calc = new Calculator(); Assert.Throws<EmptyStringException>(() => calc.Calculate("")); }