Merge pull request #7444 from Bond-009/baseurl

This commit is contained in:
Cody Robibero 2022-03-11 18:42:14 -07:00 committed by GitHub
commit 5319f1571f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
}