diff options
| author | Bond_009 <bond.009@outlook.com> | 2022-03-11 15:44:16 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2022-03-11 15:44:16 +0100 |
| commit | edeb1983139c2668450d819273f229026a48f0b5 (patch) | |
| tree | 874d36df0c2d4b448296f20e652c0b862bb0087e /tests | |
| parent | 53209830e7b566949c16b43c864f6f85336cb92c (diff) | |
Add tests for BaseUrl normalization
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Jellyfin.Networking.Tests/Configuration/NetworkConfigurationTests.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/Jellyfin.Networking.Tests/Configuration/NetworkConfigurationTests.cs b/tests/Jellyfin.Networking.Tests/Configuration/NetworkConfigurationTests.cs new file mode 100644 index 0000000000..a78b872dff --- /dev/null +++ b/tests/Jellyfin.Networking.Tests/Configuration/NetworkConfigurationTests.cs @@ -0,0 +1,28 @@ +using Jellyfin.Networking.Configuration; +using Xunit; + +namespace Jellyfin.Networking.Tests.Configuration; + +public static class NetworkConfigurationTests +{ + [Theory] + [InlineData("", null)] + [InlineData("", "")] + [InlineData("/Test", "/Test")] + [InlineData("/Test", "Test")] + [InlineData("/Test", "Test/")] + [InlineData("/Test", "/Test/")] + [InlineData("/Test/2", "/Test/2")] + [InlineData("/Test/2", "Test/2")] + [InlineData("/Test/2", "Test/2/")] + [InlineData("/Test/2", "/Test/2/")] + public static void BaseUrl_ReturnsNormalized(string expected, string input) + { + var config = new NetworkConfiguration() + { + BaseUrl = input + }; + + Assert.Equal(expected, config.BaseUrl); + } +} |
