From d7c9b141758c0cb2d1dd708fe4ce625b95d64434 Mon Sep 17 00:00:00 2001 From: David Ullmer Date: Tue, 10 Aug 2021 20:28:57 +0200 Subject: [PATCH] Apply suggestions from code review --- .../Localization/LocalizationManagerTests.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs index 0a9f4d817..e2c998b54 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs @@ -19,12 +19,11 @@ namespace Jellyfin.Server.Implementations.Tests.Localization { UICulture = "de-DE" }); - var countries = localizationManager.GetCountries(); - var countryInfos = countries.ToList(); + var countries = localizationManager.GetCountries().ToList(); - Assert.Equal(139, countryInfos.Count); + Assert.Equal(139, countries.Count); - var germany = countryInfos.FirstOrDefault(x => x.Name.Equals("DE", StringComparison.Ordinal)); + var germany = countries.FirstOrDefault(x => x.Name.Equals("DE", StringComparison.Ordinal)); Assert.NotNull(germany); Assert.Equal("Germany", germany!.DisplayName); Assert.Equal("DEU", germany.ThreeLetterISORegionName); @@ -43,7 +42,7 @@ namespace Jellyfin.Server.Implementations.Tests.Localization Assert.Equal(189, cultures.Count); - var germany = cultures.FirstOrDefault(x => x.TwoLetterISOLanguageName == "de"); + var germany = cultures.FirstOrDefault(x => x.TwoLetterISOLanguageName.Equals("de", StringComparison.Ordinal)); Assert.NotNull(germany); Assert.Equal("ger", germany!.ThreeLetterISOLanguageName); Assert.Equal("German", germany.DisplayName); @@ -86,7 +85,7 @@ namespace Jellyfin.Server.Implementations.Tests.Localization Assert.Equal(23, ratings.Count); - var tvma = ratings.FirstOrDefault(x => x.Name == "TV-MA"); + var tvma = ratings.FirstOrDefault(x => x.Name.Equals("TV-MA", StringComparison.Ordinal)); Assert.NotNull(tvma); Assert.Equal(9, tvma!.Value); } @@ -103,7 +102,7 @@ namespace Jellyfin.Server.Implementations.Tests.Localization Assert.Equal(10, ratings.Count); - var fsk = ratings.FirstOrDefault(x => x.Name == "FSK-12"); + var fsk = ratings.FirstOrDefault(x => x.Name.Equals("FSK-12", StringComparison.Ordinal)); Assert.NotNull(fsk); Assert.Equal(7, fsk!.Value); }