Exemple #1
0
        public void TestRemovesWihDeepTree()
        {
            var dict = new BinaryTreeDictionary <int, string>();

            dict.Add(1, "first value");
            dict.Add(3, "third value");
            dict.Add(7, "seventh value");
            dict.Add(11, "eleventh value");

            Assert.IsTrue(dict.Remove(3));
            Assert.IsTrue(dict.Remove(11));
            Assert.AreEqual(2, dict.Count);
        }
        public void TestRemoves()
        {
            var dictionary = new BinaryTreeDictionary <int, string>();

            dictionary.Add(8, "eight");

            Assert.IsTrue(dictionary.Remove(8));;
            Assert.AreEqual(0, dictionary.Count);;
        }
Exemple #3
0
        public void TestRemoves()
        {
            var dict = new BinaryTreeDictionary <int, string>();

            dict.Add(1, "first value");

            Assert.IsTrue(dict.Remove(1));
            Assert.AreEqual(0, dict.Count);
        }
        public void TestRemovesKeyValueWihDeepTree()
        {
            var dictionary = new BinaryTreeDictionary <int, string>();

            dictionary.Add(8, "eight");
            dictionary.Add(3, "three");
            dictionary.Add(10, "ten");
            dictionary.Add(6, "six");
            dictionary.Add(1, "one");
            dictionary.Add(14, "fourteen");
            dictionary.Add(4, "four");
            dictionary.Add(7, "seven");

            Assert.IsTrue(dictionary.Remove(new KeyValuePair <int, string>(1, "one")));;
            Assert.AreEqual(7, dictionary.Count);;
        }
        public void TestRemoveNotAdded()
        {
            var dictionary = new BinaryTreeDictionary <int, string>();

            Assert.IsFalse(dictionary.Remove(1));;
        }