diff --git a/tests/Jellyfin.Networking.Tests/Configuration/NetworkConfigurationTests.cs b/tests/Jellyfin.Networking.Tests/Configuration/NetworkConfigurationTests.cs new file mode 100644 index 000000000..a78b872df --- /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); + } +}