public void EmailTemplate_HtmlCode_01() { // Arrange var template = new HtmlEmailTemplate(); template.Load("{{html for(int i = 0; i < 3; i++) { }}{{#i}} {{ } }}"); // Act var result = template.Run(out _); // Assert Assert.Equal("0 1 2 ", result); }
public void EmailTemplate_UrlEncode_01() { // Arrange var template = new HtmlEmailTemplate(); template.Load("Hello <a href=\"http://www.localhost.com/{{#url \"Sample&Url\" }}\">Meziantou</a>!"); // Act var result = template.Run(out _); // Assert Assert.Equal("Hello <a href=\"http://www.localhost.com/Sample%26Url\">Meziantou</a>!", result); }
public void EmailTemplate_HtmlAttributeEncode_01() { // Arrange var template = new HtmlEmailTemplate(); template.Load("Hello <a href=\"{{#attr \"Sample&Sample\"}}\">Meziantou</a>!"); // Act var result = template.Run(out _); // Assert Assert.Equal("Hello <a href=\"Sample&Sample\">Meziantou</a>!", result); }
public void EmailTemplate_HtmlEncode_01() { // Arrange var template = new HtmlEmailTemplate(); template.Load("Hello {{#html \"<Meziantou>\" }}!"); // Act var result = template.Run(out _); // Assert Assert.Equal("Hello <Meziantou>!", result); }