Example #1
0
        string GetOutput(TemplateViewResult result, string format = null)
        {
            using (var writer = new StringWriter())
            {
                result.ExecuteResult(writer, format);

                return(writer.GetStringBuilder().ToString());
            }
        }
Example #2
0
        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);
        }
Example #3
0
        string GetOutput(TemplateViewResult result, string format = null)
        {
            using (var writer = new StringWriter())
            {
                result.ExecuteResult(writer, format);

                return writer.GetStringBuilder().ToString();
            }
        }