// <copyright file="NetworkConfigurationTests.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>

namespace Jellyfin.Networking.Tests.Configuration;

using MediaBrowser.Common.Net;
using Xunit;

public static class NetworkConfigurationTests
{
    [Theory]
    [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);
    }
}
