diff --git a/src/ImageProcessor.UnitTests/Extensions/StringExtensionsUnitTests.cs b/src/ImageProcessor.UnitTests/Extensions/StringExtensionsUnitTests.cs
index 17cc4c753..70f3e83db 100644
--- a/src/ImageProcessor.UnitTests/Extensions/StringExtensionsUnitTests.cs
+++ b/src/ImageProcessor.UnitTests/Extensions/StringExtensionsUnitTests.cs
@@ -124,5 +124,45 @@ namespace ImageProcessor.UnitTests
Assert.AreEqual(item.Value, result);
}
}
+
+ ///
+ /// Tests if the value is a valid URI
+ ///
+ /// The value to test
+ /// Whether the value is correct
+ ///
+ /// The full RFC3986 does not seem to pass the test with the square brackets
+ ///
+ [Test]
+ [TestCase("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", true)]
+ [TestCase("-", true)]
+ [TestCase(".", true)]
+ [TestCase("_", true)]
+ [TestCase("~", true)]
+ [TestCase(":", true)]
+ [TestCase("/", true)]
+ [TestCase("?", true)]
+ [TestCase("#", true)]
+ [TestCase("[", false)]
+ [TestCase("]", false)]
+ [TestCase("@", true)]
+ [TestCase("!", true)]
+ [TestCase("$", true)]
+ [TestCase("&", true)]
+ [TestCase("'", true)]
+ [TestCase("(", true)]
+ [TestCase(")", true)]
+ [TestCase("*", true)]
+ [TestCase("+", true)]
+ [TestCase(",", true)]
+ [TestCase(";", true)]
+ [TestCase("=", true)]
+ [TestCase("lorem ipsum", false)]
+ [TestCase("é", false)]
+ public void TestIsValidUri(string input, bool expected)
+ {
+ var result = input.IsValidVirtualPathName();
+ Assert.AreEqual(expected, result);
+ }
}
}
\ No newline at end of file