Example #1
0
        public void RegisterExprEvalWorks()
        {
            var             c     = new RootContext();
            object          r     = null;
            Action <object> saver = o => r = o;
            var             es    = new PlotLingoLib.Statements.ExpressionStatement(new StringValue("hi"));

            c.AddExpressionStatementEvaluationCallback(saver);
            es.Evaluate(c);
            Assert.AreEqual("hi", r, "result of running");
        }
Example #2
0
        public void RegisterExprEvalIgnoredByParent()
        {
            var             c     = new ScopeContext(new RootContext());
            object          r     = null;
            Action <object> saver = o => r = o;
            var             es    = new PlotLingoLib.Statements.ExpressionStatement(new StringValue("hi"));

            c.AddExpressionStatementEvaluationCallback(saver);
            es.Evaluate(c.Parent);
            Assert.IsNull(r, "result of running");
        }