Пример #1
0
        public void TestIEnumerableResult()
        {
            var exp  = new IEnumExprForTest();
            var c    = new RootContext();
            var expS = new ExpressionStatement(exp);

            expS.Evaluate(c);

            Assert.AreEqual(4, exp.NumberOfTimesCalled, "# of times the expression was evaluated");
        }
Пример #2
0
        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");
        }
Пример #3
0
        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");
        }