mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-24 22:35:49 -04:00
Fixed: Add Tests for FirstCharTo
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
using System.Globalization;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Extensions;
|
||||
|
||||
namespace NzbDrone.Common.Test.ExtensionTests.StringExtensionTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class FirstCharacterToLowerFixture
|
||||
{
|
||||
[TestCase("Hello", "hello")]
|
||||
[TestCase("CamelCase", "camelCase")]
|
||||
[TestCase("A Full Sentence", "a Full Sentence")]
|
||||
[TestCase("", "")]
|
||||
[TestCase(null, "")]
|
||||
public void should_lower_case_first_character(string input, string expected)
|
||||
{
|
||||
input.FirstCharToLower().Should().Be(expected);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_lower_case_first_character_regardless_of_culture()
|
||||
{
|
||||
var current = CultureInfo.CurrentCulture;
|
||||
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("tr-TR");
|
||||
try
|
||||
{
|
||||
"InfInite".FirstCharToLower().Should().Be("infInite");
|
||||
}
|
||||
finally
|
||||
{
|
||||
CultureInfo.CurrentCulture = current;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Extensions;
|
||||
|
||||
namespace NzbDrone.Common.Test.ExtensionTests.StringExtensionTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class FirstCharcacterToUpperFixture
|
||||
{
|
||||
[TestCase("hello", "Hello")]
|
||||
[TestCase("camelCase", "CamelCase")]
|
||||
[TestCase("a full sentence", "A full sentence")]
|
||||
[TestCase("", "")]
|
||||
[TestCase(null, "")]
|
||||
public void should_capitalize_first_character(string input, string expected)
|
||||
{
|
||||
input.FirstCharToUpper().Should().Be(expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user