Ejemplo n.º 1
0
 public void StringToLowerInvariantUnsafe(string value, string expected)
 {
     // Copy the string so we don't run into any interning issues
     value = value == null ? null : String.Copy(value);
     GlobalizationMethods.ToLowerInvariantUnsafe(value);
     value.Should().Be(expected);
 }
Ejemplo n.º 2
0
        public static bool EndsWithOrdinal(this ReadOnlySpan <char> buffer, ReadOnlySpan <char> value, bool ignoreCase = false)
        {
            if (value.Length == 0)
            {
                return(true);
            }
            else if (buffer.Length == 0 || value.Length > buffer.Length)
            {
                return(false);
            }

            if (buffer.Length != value.Length)
            {
                buffer = buffer.Slice(buffer.Length - value.Length);
            }

            return(GlobalizationMethods.CompareStringOrdinal(buffer, value, ignoreCase) == 0);
        }
Ejemplo n.º 3
0
 public void CharToLowerInvariant(char value, char expected)
 {
     GlobalizationMethods.ToLowerInvariant(value).Should().Be(expected);
 }
Ejemplo n.º 4
0
 public void StringCompareInvariant(string first, string second, bool ignoreCase, int expected)
 {
     GlobalizationMethods.CompareStringOrdinal(first, second, ignoreCase).Should().Be(expected);
 }