public void ToStringTest() { var text = "Hello"; Action<TextWriter> action = tw => tw.Write(text); var helper = new HelperResult(action); Assert.Equal(text, helper.ToString()); }
/// <summary> /// Initialize system placeholders (for map path to template styles, etc.) /// </summary> /// <param name="tpl"></param> /// <returns></returns> public static string InitializeSystemPlaceholders(HelperResult body, string templateVirtualPathPattern, string template, string templateName) { // Replace with body template = template.Replace(_phBody, body.ToString()); // Remove comments template = RemoveComments(template); // If template exists if( !string.IsNullOrEmpty( templateName ) ) { // Initialize template path placeholders template = InitTemplatePathPlaceholders(templateVirtualPathPattern, template, templateName); } return template; }