Ejemplo n.º 1
0
        public void TestUnion()
        {
            FasterDictionary <int, int> test1 = new FasterDictionary <int, int>();
            FasterDictionary <int, int> test2 = new FasterDictionary <int, int>();

            for (int i = 0; i < 100; ++i)
            {
                test1.Add(i, i);
            }

            for (int i = 0; i < 200; i += 2)
            {
                test2.Add(i, i);
            }

            test1.Union(test2);

            Assert.AreEqual(150, test1.count);

            for (int i = 0; i < 100; i++)
            {
                Assert.IsTrue(test1.ContainsKey(i));
            }

            for (int i = 100; i < 200; i += 2)
            {
                Assert.IsTrue(test1.ContainsKey(i));
            }
        }
Ejemplo n.º 2
0
        public void TestFastClear()
        {
            FasterDictionary <int, int> test = new FasterDictionary <int, int>();

            test.Add(0, 0);

            Assert.IsTrue(test.ContainsKey(0));

            test.FastClear();

            Assert.IsFalse(test.ContainsKey(0));
        }