Beispiel #1
0
        public void TestEvalWithReferenceInResult()
        {
            var exprEval = new ZeroCode2.Interpreter.Evaluator.ExpressionEvaluator();
            var context  = new ZeroCode2.Interpreter.InterpreterContext
            {
                Model = ModelCollector
            };

            var res = exprEval.Evaluate(context, "@Models.Person.CodeField");

            Assert.IsTrue(res.Value == "<Input Type='string' >");
            Assert.IsTrue(res.Result == ZeroCode2.Interpreter.Evaluator.EvaluationResultValues.True);
        }
Beispiel #2
0
        public void TestEscapedQuoteCharacters()
        {
            var exprEval = new ZeroCode2.Interpreter.Evaluator.ExpressionEvaluator();
            var context  = new ZeroCode2.Interpreter.InterpreterContext
            {
                Model = ModelCollector
            };

            var res = exprEval.Evaluate(context, "@Models.Quotes.EscapedQuoteField");

            Assert.IsTrue(res.Value == "This is an escaped quote: \\\"");
            Assert.IsTrue(res.Result == ZeroCode2.Interpreter.Evaluator.EvaluationResultValues.True);
        }
Beispiel #3
0
        public void TestEvalWithReference()
        {
            var exprEval = new ZeroCode2.Interpreter.Evaluator.ExpressionEvaluator();
            var context  = new ZeroCode2.Interpreter.InterpreterContext
            {
                Model = ModelCollector
            };

            var res = exprEval.Evaluate(context, "@Models.Person.[#Parameters.reference].[#Parameters.[#Parameters.reference1]2]ame");

            Assert.IsTrue(res.Value == "Name");
            Assert.IsTrue(res.Result == ZeroCode2.Interpreter.Evaluator.EvaluationResultValues.True);
        }