Пример #1
0
        public void TestEqualityComparerBasic()
        {
            MyHashtable       hsh1;
            IEqualityComparer ikc;

            //[] Default ctor
            hsh1 = new MyHashtable();
            Assert.Null(hsh1.EqualityComparer);

            //[] ctor(IKeyComparer)
            System.Globalization.CultureInfo prevCulture = System.Globalization.CultureInfo.DefaultThreadCurrentCulture;
            System.Globalization.CultureInfo.DefaultThreadCurrentCulture = new System.Globalization.CultureInfo("de-DE");
            ikc  = StringComparer.CurrentCulture;
            hsh1 = new MyHashtable(0, 1.0f, ikc);

            Assert.Equal(ikc, hsh1.EqualityComparer);
            System.Globalization.CultureInfo.DefaultThreadCurrentCulture = prevCulture;
        }
        public void TestEqualityComparerBasic()
        {
            MyHashtable hsh1;
            IEqualityComparer ikc;

            //[] Default ctor
            hsh1 = new MyHashtable();
            Assert.Null(hsh1.EqualityComparer);

            //[] ctor(IKeyComparer)
            System.Globalization.CultureInfo prevCulture = System.Globalization.CultureInfo.DefaultThreadCurrentCulture;
            System.Globalization.CultureInfo.DefaultThreadCurrentCulture = new System.Globalization.CultureInfo("de-DE");
            ikc = StringComparer.CurrentCulture;
            hsh1 = new MyHashtable(0, 1.0f, ikc);

            Assert.Equal(ikc, hsh1.EqualityComparer);
            System.Globalization.CultureInfo.DefaultThreadCurrentCulture = prevCulture;
        }