public void CloneTest() { var exp = new DivAssign(Variable.X, new Number(2)); var clone = exp.Clone(); Assert.Equal(exp, clone); }
public void BoolDivNumberTest() { var parameters = new ParameterCollection() { new Parameter("x", true) }; var add = new DivAssign(Variable.X, new Number(2)); Assert.Throws <NotSupportedException>(() => add.Execute(parameters)); }
public void DivAssignCalc() { var parameters = new ParameterCollection() { new Parameter("x", 10) }; var div = new DivAssign(Variable.X, new Number(2)); var result = div.Execute(parameters); var expected = 5.0; Assert.Equal(expected, result); Assert.Equal(expected, parameters["x"]); }
/// <summary> /// Analyzes the specified expression. /// </summary> /// <param name="exp">The expression.</param> /// <returns> /// The result of analysis. /// </returns> /// <exception cref="System.NotSupportedException">Always.</exception> public virtual TResult Analyze(DivAssign exp) { throw new NotSupportedException(); }
/// <summary> /// Analyzes the specified expression. /// </summary> /// <param name="exp">The expression.</param> /// <returns>The result of analysis.</returns> public string Analyze(DivAssign exp) { return(ToString(exp, "{0} /= {1}")); }
public void DivAssignToString() { var exp = new DivAssign(Variable.X, new Number(5)); Assert.Equal("x /= 5", exp.ToString(commoonFormatter)); }
public void TestDivAssignException() { var exp = new DivAssign(Variable.X, new Bool(false)); TestException(exp); }
public void TestDivAssignNumber() { var exp = new DivAssign(Variable.X, new Number(10)); Test(exp, ResultType.Number); }
public void TestDivAssignUndefined() { var exp = new DivAssign(Variable.X, Variable.X); Test(exp, ResultType.Undefined); }