Пример #1
0
        public void TestCustomizedHashMapConstructors()
        {
            var orders = new Customized32HashedMap <string, Order>();

            orders.HashAbility();

            var orders2 = new Customized32HashedMap <string, Order>(1000);

            orders2.HashAbility();

            var orders3 = new Customized32HashedMap <string, Order>(100, x => x.ToBytes());

            orders3.HashAbility();

            var orders4 = new Customized32HashedMap <string, Order>(500, x => x.ToBytes(), (x1, x2) => x1 == x2);

            orders4.HashAbility();

            var orders5 = new Customized32HashedMap <string, Order>(500, x => x.ToBytes(), EqualityComparer <string> .Default);

            orders5.HashAbility();

            var orders7 = new Customized32HashedMap <string, Order>(1000, new MurmurHash32(), x => x.ToBytes(), (x1, x2) => x1 == x2);

            orders7.HashAbility();


            var orders9 = new Customized32HashedMap <string, Order>(orders7, new MurmurHash32(), x => x.ToBytes(), (x1, x2) => x1 == x2);

            Assert.NotEmpty(orders9);
            Assert.Equal(orders7.Count, orders9.Count);
        }
Пример #2
0
        public void TestHashAbility()
        {
            var orders = new Customized32HashedMap <string, Order>(4);

            orders.HashAbility();
        }