Ejemplo n.º 1
0
        public void Can_remove_the_stored_item_twice()
        {
            var map = new IntHashMap <string>(2);

            map.AddOrUpdate(42, "1");
            map.AddOrUpdate(41, "41");
            map.AddOrUpdate(42 + 32, "2");
            map.AddOrUpdate(43, "43");
            map.AddOrUpdate(42 + 32 + 32, "3");

            // removing twice
            map.Remove(42 + 32);
            map.Remove(42 + 32);

            Assert.AreEqual(4, map.Count);
            Assert.AreEqual("3", map.GetValueOrDefault(42 + 32 + 32));
        }
Ejemplo n.º 2
0
        public void Can_remove_the_stored_item()
        {
            var map = new IntHashMap <string>();

            map.AddOrUpdate(42, "1");
            map.AddOrUpdate(42 + 32, "2");
            map.AddOrUpdate(42 + 32 + 32, "3");

            map.Remove(42 + 32);

            Assert.AreEqual(2, map.Count);
            Assert.AreEqual("3", map.GetValueOrDefault(42 + 32 + 32));
        }