Exemplo n.º 1
0
        public void CodeStatementsPercentSyntax()
        {
            var direct = grammar.Statement(Source("<%int x = 5;%>"));

            Assert.AreEqual("int x = 5;", (string)direct.Value.Code);

            var result = grammar.Nodes(Source("<div>hello <%int x = 5;%> world</div>"));

            Assert.IsNotNull(result);
            Assert.AreEqual(5, result.Value.Count);
            var stmt = result.Value[2] as StatementNode;

            Assert.IsNotNull(stmt);
            Assert.AreEqual("int x = 5;", (string)stmt.Code);
        }