You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/tests/Jellyfin.Providers.Tests/Tmdb/TmdbUtilsTests.cs

38 lines
1.2 KiB

using MediaBrowser.Providers.Plugins.Tmdb;
using Xunit;
namespace Jellyfin.Providers.Tests.Tmdb
{
public static class TmdbUtilsTests
{
[Theory]
[InlineData("de", "de")]
[InlineData("En", "En")]
[InlineData("de-de", "de-DE")]
[InlineData("en-US", "en-US")]
[InlineData("de-CH", "de")]
public static void NormalizeLanguage_Valid_Success(string input, string expected)
{
Assert.Equal(expected, TmdbUtils.NormalizeLanguage(input));
}
[Theory]
[InlineData(null, null)]
[InlineData("", "")]
public static void NormalizeLanguage_Invalid_Equal(string? input, string? expected)
{
Assert.Equal(expected, TmdbUtils.NormalizeLanguage(input!));
}
[Theory]
[InlineData("en", "en-US", "en-US")]
[InlineData("fr-CA", "fr-BE", "fr-CA")]
[InlineData("fr-CA", "fr", "fr-CA")]
[InlineData("de", "en-US", "de")]
11 months ago
public static void AdjustImageLanguage_Valid_Success(string imageLanguage, string requestLanguage, string? expected)
{
Assert.Equal(expected, TmdbUtils.AdjustImageLanguage(imageLanguage, requestLanguage));
}
}
}