aboutsummaryrefslogtreecommitdiff
path: root/dotnet
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-04-28 22:17:02 +0100
committerMichael Williamson <mike@zwobble.org>2016-04-28 22:17:02 +0100
commitf563dc02191e2261224077942f27ecbd70566b68 (patch)
tree0a3986b577d8935030717f2939cd1c393da152f0 /dotnet
parent63b8685c562d1ec2c27b642e3d9ded3f7be46c86 (diff)
Test warning when path of document is unknown
Diffstat (limited to 'dotnet')
-rw-r--r--dotnet/Mammoth.Tests/DocumentConverterTests.cs11
1 files changed, 10 insertions, 1 deletions
diff --git a/dotnet/Mammoth.Tests/DocumentConverterTests.cs b/dotnet/Mammoth.Tests/DocumentConverterTests.cs
index 77b1207..de1c37c 100644
--- a/dotnet/Mammoth.Tests/DocumentConverterTests.cs
+++ b/dotnet/Mammoth.Tests/DocumentConverterTests.cs
@@ -64,7 +64,16 @@ namespace Mammoth.Tests {
AssertSuccessfulConversion(
ConvertToHtml("external-picture.docx"),
"<p><img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAOvgAADr4B6kKxwAAAABNJREFUKFNj/M+ADzDhlWUYqdIAQSwBE8U+X40AAAAASUVORK5CYII=\" /></p>");
- }
+ }
+
+ [Fact]
+ public void WarnIfDocumentHasImagesStoredOutsideOfDocumentWhenPathOfDocumentIsUnknown() {
+ using (var file = File.OpenRead(TestFilePath("external-picture.docx"))) {
+ var result = new DocumentConverter().ConvertToHtml(file);
+ Assert.Equal("", result.Value);
+ Assert.Equal(new[]{"could not open external image 'tiny-picture.png': path of document is unknown, but is required for relative URI"}, result.Warnings);
+ }
+ }
// TODO: image warnings