public void SolveTest() { Expression operand1 = new ValueExpression(10); // TODO: Initialize to an appropriate value Expression operand2 = new ValueExpression(2); // TODO: Initialize to an appropriate value DivideExpression target = new DivideExpression(operand1, operand2); // TODO: Initialize to an appropriate value Expression expected = new ValueExpression(5); // TODO: Initialize to an appropriate value Expression actual; actual = target.Solve(); Assert.AreEqual(((ValueExpression)expected).GetValue(), ((ValueExpression)actual).GetValue()); }
public void SolveZeroTest() { Expression operand1 = new ValueExpression(4); // TODO: Initialize to an appropriate value Expression operand2 = new ValueExpression(0); // TODO: Initialize to an appropriate value DivideExpression target = new DivideExpression(operand1, operand2); Expression actual = target.Solve(); Assert.IsTrue(Double.IsInfinity(((ValueExpression)actual).GetValue())); }