public void TestBasicExecution() { var exp = new simpleExprForTest(); var c = new RootContext(); var expS = new ExpressionStatement(exp); expS.Evaluate(c); Assert.AreEqual(1, exp.NumberOfTimesCalled, "# of times the expression was evaluated"); }
public void TestEvaluationCallback() { var exp = new simpleExprForTest(); int count = 0; var c = new RootContext(); c.AddExpressionStatementEvaluationCallback(o => { count++; Assert.IsNull(o, "callback object"); }); var expS = new ExpressionStatement(exp); expS.Evaluate(c); Assert.AreEqual(1, count, "# of times callback was called"); }