public void Test1() { string input = "3+4*2"; IComplexMath test = new ComplexMath(); Assert.AreEqual(test.EvaluateExpression(input), 11); }
public void TestExpression2() { // Arrange string input = "1+3-2+2"; IComplexMath cm = new ComplexMath(); float ans = 1 + 3 - 2 + 2; // Act float res = cm.EvaluateExpression(input); // Assert Assert.AreEqual(res, ans); }
public void TestExpression() { // Arrange string input = "3+ 4*2 - 3/2 * 5"; IComplexMath cm = new ComplexMath(); float ans = 3 + 4 * 2 - (float)3 / 2 * 5; // Act float res = cm.EvaluateExpression(input); // Assert Assert.AreEqual(res, ans); }