Exemple #1
0
        public void ContainsValueTest()
        {
            var set = UnsafeSortedDictionary.Allocate <int, int>(10);

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

            UnsafeSortedDictionary.Add(set, 1, 5);
            UnsafeSortedDictionary.Add(set, 2, 2);
            UnsafeSortedDictionary.Add(set, 3, 38);

            Assert.IsTrue(UnsafeSortedDictionary.ContainsValue <int>(set, 2));
            Assert.IsTrue(UnsafeSortedDictionary.ContainsValue <int>(set, 38));
            Assert.IsFalse(UnsafeSortedDictionary.ContainsValue <int>(set, 1));

            UnsafeSortedDictionary.Free(set);
        }
Exemple #2
0
        public void ContainsTest()
        {
            var set = UnsafeSortedDictionary.Allocate <int, int>(10);

            Assert.IsFalse(UnsafeSortedDictionary.ContainsKey <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.ContainsKey <int>(set, 3));

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

            Assert.IsFalse(UnsafeSortedDictionary.ContainsKey <int>(set, 14));

            UnsafeSortedDictionary.Free(set);
        }