public void TestEmpty() { PatriciaTrie <string> trie = new PatriciaTrie <string>(); Assert.IsTrue(trie.IsEmpty()); trie["hello"] = "world"; Assert.IsFalse(trie.IsEmpty()); }
public void TestEmptyInsert() { PatriciaTrie <string> trie = new PatriciaTrie <string>(); Assert.IsTrue(trie.IsEmpty()); trie[""] = "i am empty bottle of beer!"; Assert.IsFalse(trie.IsEmpty()); Assert.AreEqual("i am empty bottle of beer!", trie[""]); trie[""] = "...and i'm an empty bottle of sake"; Assert.AreEqual("...and i'm an empty bottle of sake", trie[""]); }
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); }