string GetOutput(TemplateViewResult result, string format = null) { using (var writer = new StringWriter()) { result.ExecuteResult(writer, format); return(writer.GetStringBuilder().ToString()); } }
public void ReplaceLinkedImagesWithEmbeddedImages_replaces_cid_reference_with_correct_mime() { var embedder = new ImageEmbedder(); var resource = embedder.ReferenceImage("postal.png"); string body = "<img src=\"cid:" + resource.ContentId + @"""/>"; var view = AlternateView.CreateAlternateViewFromString(body); embedder.AddImagesToView(view); string replaced = TemplateViewResult.ReplaceLinkedImagesWithEmbeddedImages(view, body); Assert.Contains("data:image/png;base64,", replaced); }
string GetOutput(TemplateViewResult result, string format = null) { using (var writer = new StringWriter()) { result.ExecuteResult(writer, format); return writer.GetStringBuilder().ToString(); } }