Пример #1
0
        public void RemoveTest()
        {
            var set = UnsafeSortedDictionary.Allocate <int, int>(10);

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

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

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

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

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

            UnsafeSortedDictionary.Free(set);
        }