예제 #1
0
        public void RemoveTest()
        {
            var set = UnsafeDictionary.Allocate <int, int>(10);

            Assert.IsFalse(UnsafeDictionary.Remove <int>(set, 1));

            UnsafeDictionary.Add(set, 1, 3);
            UnsafeDictionary.Add(set, 7, 3);
            UnsafeDictionary.Add(set, 51, 3);
            UnsafeDictionary.Add(set, 13, 3);

            Assert.IsFalse(UnsafeDictionary.Remove <int>(set, 3));

            Assert.IsTrue(UnsafeDictionary.Remove <int>(set, 1));
            Assert.IsTrue(UnsafeDictionary.Remove <int>(set, 7));
            Assert.IsTrue(UnsafeDictionary.Remove <int>(set, 13));
            Assert.IsTrue(UnsafeDictionary.Remove <int>(set, 51));

            Assert.IsFalse(UnsafeDictionary.Remove <int>(set, 13));

            UnsafeDictionary.Free(set);
        }