public void EmailMessages_FindAndReplaceImageTagsWithAttachedImage_HtmlBodyNoImage() { string localHtml = @"<html><head><title>Email Stuff</head><body><p><hr><a href=""http://www.google.com"">Google Link</a>Check out my <i>great</i> link!</p></body></html>"; bool areImagesDownloaded = false; string actualLocalPath = EmailMessages.FindAndReplaceImageTagsWithAttachedImage(localHtml, areImagesDownloaded, out List <string> listLocalImagePaths); Assert.AreEqual(actualLocalPath, localHtml); }
public void EmailMessages_FindAndReplaceImageTagsWithAttachedImage_ClosingSlashInsideImg() { string localHtml = @"<html><head><title>Email Stuff</head><body><img src=""image""/></body></html>"; bool areImagesDownloaded = false; string actualLocalPath = EmailMessages.FindAndReplaceImageTagsWithAttachedImage(localHtml, areImagesDownloaded, out List <string> listLocalImagePaths); string expectedLocalPath = @"<html><head><title>Email Stuff</head><body><img alt=""image"" src=""cid:image""/></body></html>"; Assert.AreEqual(expectedLocalPath, actualLocalPath); }
public void EmailMessages_FindAndReplaceImageTagsWithAttachedImage_HtmlBodyWithMultiImages() { string localHtml = @"<html><head><title>Email Stuff</head><body><p>Text Text Text Text<img src=""image""></img><span></span><img src=""image2""></img>Text Text Text Text</p></body></html>"; bool areImagesDownloaded = false; string actualLocalPath = EmailMessages.FindAndReplaceImageTagsWithAttachedImage(localHtml, areImagesDownloaded, out List <string> listLocalImagePaths); string expectedLocalPath = @"<html><head><title>Email Stuff</head><body><p>Text Text Text Text<img alt=""image"" src=""cid:image""/><span></span><img alt=""image"" src=""cid:image2""/>Text Text Text Text</p></body></html>"; Assert.AreEqual(expectedLocalPath, actualLocalPath); }