diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-04-28 22:17:02 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-04-28 22:17:02 +0100 |
| commit | f563dc02191e2261224077942f27ecbd70566b68 (patch) | |
| tree | 0a3986b577d8935030717f2939cd1c393da152f0 | |
| parent | 63b8685c562d1ec2c27b642e3d9ded3f7be46c86 (diff) | |
Test warning when path of document is unknown
| -rw-r--r-- | dotnet/Mammoth.Tests/DocumentConverterTests.cs | 11 |
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 |
