public static HtmlString ToHtml(this IEnumerable <IHtmlControl> controls) { var renderer = new ControlsHtmlRenderer(); var html = renderer.ToHtml(controls); return(html); }
public void Then_The_To_Html_Method_Returns_The_Constructed_Html(ControlsHtmlRenderer htmlRenderer) { var controlsToRender = new List <IHtmlControl> { new ParagraphBuilder().AddText("some text").Build() }; var actual = htmlRenderer.ToHtml(controlsToRender); actual.Value.Should().NotBeNullOrWhiteSpace(); actual.Value.Should().Be("<p>some text</p>"); }