Ejemplo n.º 1
0
        public void DoubleHashMapFillingTest()
        {
            ModFunction           function = new ModFunction();
            HashMap <int, Client> map      = new HashMap <int, Client>(function,
                                                                       new DoubleHashStorage <int, Client>(new OddFunction(), function));

            for (int i = 0; i < 20; i++)
            {
                Client client = new Client(i, "" + i, "name" + i);
                map.Add(client);
            }
            Assert.AreEqual(20, map.Size());
        }
Ejemplo n.º 2
0
        public void DoubleHashMapSameSlotTest()
        {
            Client                client1  = new Client(17, "1", "sidorov");
            Client                client2  = new Client(33, "2", "petrov");
            Client                client3  = new Client(49, "3", "ivanov");
            Client                client4  = new Client(4, "4", "smirnov");
            ModFunction           function = new ModFunction();
            HashMap <int, Client> map      = new HashMap <int, Client>(function,
                                                                       new DoubleHashStorage <int, Client>(new OddFunction(), function));

            map.Add(client1);
            map.Add(client2);
            map.Add(client3);
            map.Add(client4);
            Assert.AreEqual(4, map.Size());
            map.Remove(client2);
            Assert.AreEqual(3, map.Size());
        }