using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Mustache.Test { [TestClass] public class HtmlFormatCompilerTester { [TestMethod] public void ShouldEscapeValueContainingHTMLCharacters() { HtmlFormatCompiler compiler = new HtmlFormatCompiler(); var generator = compiler.Compile("Hello, {{Name}}!!!"); string html = generator.Render(new { Name = "John \"The Man\" Standford" }); Assert.AreEqual("Hello, John "The Man" Standford!!!", html); } [TestMethod] public void ShouldIgnoreHTMLCharactersInsideTripleCurlyBraces() { HtmlFormatCompiler compiler = new HtmlFormatCompiler(); var generator = compiler.Compile("Hello, {{{Name}}}!!!"); string html = generator.Render(new { Name = "John \"The Man\" Standford" }); Assert.AreEqual("Hello, John \"The Man\" Standford!!!", html); } } }