Skip to content

Commit 6f93942

Browse files
Add test for UriResolver#resolveAgainstBaseUri method
DEVSIX-6137
1 parent f89ccee commit 6f93942

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

itext.tests/itext.styledxmlparser.tests/itext/styledxmlparser/resolver/resource/UriResolverTest.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ source product.
4747

4848
namespace iText.StyledXmlParser.Resolver.Resource {
4949
public class UriResolverTest : ExtendedITextTest {
50+
51+
public static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
52+
.CurrentContext.TestDirectory) + "/resources/com/itextpdfstyledxmlparser/resolver/resource/UriResolverTest/";
5053

5154
[NUnit.Framework.Test]
5255
public virtual void UriResolverTest01() {
@@ -106,6 +109,15 @@ public virtual void UriResolverTest06() {
106109
String parentFolder = new Uri(Directory.GetParent(Directory.GetCurrentDirectory()).FullName).ToExternalForm() + "/";
107110
TestPaths(parentFolder, resolver);
108111
}
112+
113+
[NUnit.Framework.Test]
114+
public virtual void ResolveAgainstBaseUriTest() {
115+
String baseUrl = "https://test";
116+
UriResolver resolver = new UriResolver(SOURCE_FOLDER);
117+
resolver.ResolveAgainstBaseUri(baseUrl);
118+
NUnit.Framework.Assert.IsTrue(resolver.IsLocalBaseUri());
119+
NUnit.Framework.Assert.IsTrue(resolver.GetBaseUri().StartsWith("file:"));
120+
}
109121

110122
[NUnit.Framework.Test]
111123
public virtual void UriResolverTest07() {

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
47990ec87ab8d135efb03cadd52411aed4502211
1+
7f177b417d18be1b18bfbf972f33835887b0bfb9

0 commit comments

Comments
 (0)