Example #1
0
        public void TestClear()
        {
            var trie = new PatriciaTrie <string>();

            trie.Count.Is(0);
            trie.Add("hello", "world");
            trie.Add("world", "hello");
            trie.Count.Is(2);
            trie.Clear();
            trie.Count.Is(0);
        }
        public void TestClear()
        {
            PatriciaTrie <string> trie = new PatriciaTrie <string>();

            Assert.IsTrue(trie.IsEmpty());
            Assert.AreEqual(0, trie.Count);
            trie["hello"] = "world";
            trie["world"] = "hello";
            Assert.IsFalse(trie.IsEmpty());
            trie.Clear();
            Assert.IsTrue(trie.IsEmpty());
            Assert.AreEqual(0, trie.Count);
        }