public void GetComparer_InvariantCultureIgnoreCase() { //Act var actual = CharComparer.GetComparer(StringComparison.InvariantCultureIgnoreCase); //Assert actual.Should().Be(CharComparer.InvariantCultureIgnoreCase); }
public void GetComparer_OrdinalIgnoreCase() { //Act var actual = CharComparer.GetComparer(StringComparison.OrdinalIgnoreCase); //Assert actual.Should().Be(CharComparer.OrdinalIgnoreCase); }
public void Compare_CurrentCultureIgnoreCase_FirstLessThanSecond() { //Act - Cannot actually detect comparer type so use heuristics var target = CharComparer.GetComparer(StringComparison.CurrentCultureIgnoreCase); var actual = target.Compare(SmallLetterI, SmallDotlessLetterI); //Assert actual.Should().Be(-1); }
public void Compare_CurrentCultureIgnoreCase_MixedCase() { //Act - Cannot actually detect comparer type so use heuristics var target = CharComparer.GetComparer(StringComparison.CurrentCultureIgnoreCase); var actual = target.Compare(CapitalLetterI, SmallLetterI); //Assert actual.Should().Be(0); }
public void Compare_CurrentCultureIgnoreCase_SameCase() { //Act var target = CharComparer.GetComparer(StringComparison.CurrentCultureIgnoreCase); var actual = target.Compare(CapitalLetterI, CapitalLetterI); //Assert actual.Should().Be(0); }
public void GetComparer_CurrentCultureIgnoreCase() { //Act - Cannot actually detect comparer type so use heuristics var target = CharComparer.GetComparer(StringComparison.CurrentCultureIgnoreCase); var actual = target.Compare('A', 'a'); //Assert actual.Should().Be(0); }
public void Compare_OrdinalIgnoreCase_FirstGreaterThanSecond() { //Act - Cannot actually detect comparer type so use heuristics var target = CharComparer.GetComparer(StringComparison.OrdinalIgnoreCase); var actual = target.Compare(SmallDotlessLetterI, CapitalLetterI); //Assert actual.Should().Be(1); }
public void Compare_Ordinal_MixedCase() { //Act - Cannot actually detect comparer type so use heuristics var target = CharComparer.GetComparer(StringComparison.Ordinal); var actual = target.Compare(CapitalLetterI, SmallLetterI); //Assert actual.Should().NotBe(0); }
public void Compare_Ordinal_SameCase() { //Act var target = CharComparer.GetComparer(StringComparison.Ordinal); var actual = target.Compare(SmallLetterI, SmallLetterI); //Assert actual.Should().Be(0); }
public void Compare_InvariantCultureIgnoreCase_SameCase() { //Act var target = CharComparer.GetComparer(StringComparison.InvariantCultureIgnoreCase); var actual = target.Compare(SmallDotlessLetterI, SmallDotlessLetterI); //Assert actual.Should().Be(0); }
public void GetComparer_BadComparison() { Action action = () => CharComparer.GetComparer((StringComparison)1000); action.ShouldThrowArgumentOutOfRangeException(); }