private static void GenerateTemplatedContentWithEscaping()
        {
            var         escapedPattern = ParseContext.GenerateEscapedPattern('@');
            ParseResult res            = Parser.Parse(TemplateContent, escapedPattern);

            Console.WriteLine("******************** Substituted content");
            var ctx = res.Execute(ExecutionContext.Build(Client)).context;

            Console.WriteLine(ctx.ToString());
        }
示例#2
0
        public void Given_ValidParsedExecutable_When_UsingEscapedScanPattern_Then_PreserveEscapedSequences()
        {
            var                  escapedPattern = ParseContext.GenerateEscapedPattern('@');
            ParseResult          res            = Parser.Parse("Hello, [Client.FirstName], this is a weird sequence @[Address]@, but your user name is still [UserName] ", escapedPattern);
            EvaluationContext    ec             = EvaluationContext.From(Client);
            IEnumerable <string> expected       = new[] {
                "Toe",
                "@[Address]@",
                "XX2"
            };

            ExecuteAndExpect(res, ec, expected);
        }