From f563dc02191e2261224077942f27ecbd70566b68 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 28 Apr 2016 22:17:02 +0100 Subject: Test warning when path of document is unknown --- dotnet/Mammoth.Tests/DocumentConverterTests.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'dotnet') 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"), "

"); - } + } + + [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 -- cgit v1.2.3