public void EscapesHtmlByDefault() { var factory = new RazorTemplateFactory(); const string str = "There are @(\"<i>\") AppSettings entries."; var template = factory.CreateHtmlTemplate <object>(new StringReader(str)); Assert.Equal("There are <i> AppSettings entries.", template.Execute(new object()) as string); }
public void DoesNotEscapeIHtmlString() { var factory = new RazorTemplateFactory(); const string str = "There are @(new System.Web.HtmlString(\"<i>\")) AppSettings entries."; var template = factory.CreateHtmlTemplate <object>(new StringReader(str)); Assert.Equal("There are <i> AppSettings entries.", template.Execute(new object()) as string); }