public void ShouldReportAndErrorOnEmptyTags() { var parser = new CustomParser(); parser.RegisterEmptyTag("hello", (w, e, c) => { w.Write("Hello World"); return(Statement.Normal()); }); Assert.Throws <ParseException>(() => parser.Parse("{% hello foo %}")); }
public void ShouldRenderEmptyTags() { var parser = new CustomParser(); parser.RegisterEmptyTag("hello", (w, e, c) => { w.Write("Hello World"); return(Statement.Normal()); }); var template = parser.Parse("{% hello %}"); var result = template.Render(); Assert.Equal("Hello World", result); }