public static void ToLowerToUpperInvariant_ASCII()
{
var asciiChars = new char[128];
var asciiCharsUpper = new char[128];
var asciiCharsLower = new char[128];
for (int i = 0; i < asciiChars.Length; i++)
{
char c = (char)i;
asciiChars[i] = c;
// Purposefully avoiding char.ToUpper/ToLower here so as not to use the same thing we're testing.
asciiCharsLower[i] = (c >= 'A' && c <= 'Z') ? (char)(c - 'A' + 'a') : c;
asciiCharsUpper[i] = (c >= 'a' && c <= 'z') ? (char)(c - 'a' + 'A') : c;
}
var ascii = new string(asciiChars);
var asciiLower = new string(asciiCharsLower);
var asciiUpper = new string(asciiCharsUpper);
Assert.Equal(asciiLower, ascii.ToLowerInvariant());
Assert.Equal(asciiUpper, ascii.ToUpperInvariant());
}