From c71b4bde86ae9c183e952214a203e18714916ead Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sat, 15 Jun 2019 20:59:20 +0200 Subject: [PATCH] Added test for turkish FirstCharToUpper --- .../FirstCharcacterToUpperFixture.cs | 18 +++++++++++++++++- .../NzbDrone.Core.Test.csproj | 2 +- ....cs => SeriesTitleFirstCharacterFixture.cs} | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) rename src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/{SeriesTitleFirstCharcterFixture.cs => SeriesTitleFirstCharacterFixture.cs} (95%) diff --git a/src/NzbDrone.Common.Test/ExtensionTests/StringExtensionTests/FirstCharcacterToUpperFixture.cs b/src/NzbDrone.Common.Test/ExtensionTests/StringExtensionTests/FirstCharcacterToUpperFixture.cs index 53e221f4e..5013ddd73 100644 --- a/src/NzbDrone.Common.Test/ExtensionTests/StringExtensionTests/FirstCharcacterToUpperFixture.cs +++ b/src/NzbDrone.Common.Test/ExtensionTests/StringExtensionTests/FirstCharcacterToUpperFixture.cs @@ -1,4 +1,5 @@ -using FluentAssertions; +using System.Globalization; +using FluentAssertions; using NUnit.Framework; using NzbDrone.Common.Extensions; @@ -16,5 +17,20 @@ public void should_capitalize_first_character(string input, string expected) { input.FirstCharToUpper().Should().Be(expected); } + + [Test] + public void should_capitalize_first_character_regardless_of_culture() + { + var current = CultureInfo.CurrentCulture; + CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("tr-TR"); + try + { + "infInite".FirstCharToUpper().Should().Be("InfInite"); + } + finally + { + CultureInfo.CurrentCulture = current; + } + } } } diff --git a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index 728fd0241..6fea040e0 100644 --- a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -349,7 +349,7 @@ - + diff --git a/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/SeriesTitleFirstCharcterFixture.cs b/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/SeriesTitleFirstCharacterFixture.cs similarity index 95% rename from src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/SeriesTitleFirstCharcterFixture.cs rename to src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/SeriesTitleFirstCharacterFixture.cs index 944ec8dee..763b948a6 100644 --- a/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/SeriesTitleFirstCharcterFixture.cs +++ b/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/SeriesTitleFirstCharacterFixture.cs @@ -10,7 +10,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests { [TestFixture] - public class SeriesTitleFirstCharcterFixture : CoreTest + public class SeriesTitleFirstCharacterFixture : CoreTest { private Series _series; private NamingConfig _namingConfig;