System.Collections.Tests.CaseInsensitiveHashCodeProviderTests.Ctor_CultureInfo_ChangeCurrentCulture_GetHashCodeCompare C# (CSharp) Method

Ctor_CultureInfo_ChangeCurrentCulture_GetHashCodeCompare() private method

private Ctor_CultureInfo_ChangeCurrentCulture_GetHashCodeCompare ( object a, object b, bool expected ) : void
a object
b object
expected bool
return void
        public static void Ctor_CultureInfo_ChangeCurrentCulture_GetHashCodeCompare(object a, object b, bool expected)
        {
            var cultureNames = new string[]
            {
                "cs-CZ","da-DK","de-DE","el-GR","en-US",
                "es-ES","fi-FI","fr-FR","hu-HU","it-IT",
                "ja-JP","ko-KR","nb-NO","nl-NL","pl-PL",
                "pt-BR","pt-PT","ru-RU","sv-SE","tr-TR",
                "zh-CN","zh-HK","zh-TW"
            };

            foreach (string cultureName in cultureNames)
            {
                CultureInfo culture;
                try
                {
                    culture = new CultureInfo(cultureName);
                }
                catch (CultureNotFoundException)
                {
                    continue;
                }

                var provider = new CaseInsensitiveHashCodeProvider(culture);
                Assert.Equal(provider.GetHashCode(a), provider.GetHashCode(a));
                Assert.Equal(provider.GetHashCode(b), provider.GetHashCode(b));
                Assert.Equal(expected, provider.GetHashCode(a) == provider.GetHashCode(b));
            }
        }