From 8e00c09e4f9503b4ec8383987135cf26965e291d Mon Sep 17 00:00:00 2001 From: Olivier Nizet Date: Sun, 13 Oct 2024 21:17:33 +0200 Subject: [PATCH] Improve code coverage --- test/HtmlToOpenXml.Tests/ParserTests.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/HtmlToOpenXml.Tests/ParserTests.cs b/test/HtmlToOpenXml.Tests/ParserTests.cs index 9342eff..a3dcd8b 100644 --- a/test/HtmlToOpenXml.Tests/ParserTests.cs +++ b/test/HtmlToOpenXml.Tests/ParserTests.cs @@ -140,5 +140,13 @@ public void ProvidedMainPartDocument_WithNull_ShouldBeAssigned() var elements = new HtmlConverter(mainPart).Parse("Placeholder"); Assert.That(elements, Is.Not.Empty); } + + [Test(Description = "Provided BaseImageUrl must be an absolute uri")] + public void ProvidedBaseImageUrl_WithRelativeUrl_ShouldFail() + { + Assert.Throws(() => new HtmlConverter(mainPart, new IO.DefaultWebRequest { + BaseImageUrl = new Uri("/path", UriKind.Relative) + })); + } } } \ No newline at end of file