[Test] public void Test_Main() { Trie t = new Trie(); t["one"] = "two"; Assert.AreEqual("two", t["one"]); Assert.AreEqual(t.Count, 1); t.Remove("one"); Assert.AreEqual(t.Count, 0); Assert.AreEqual(null, t["one"]); }
[Test] public void Test_Clear() { Trie t = new Trie(); Assert.AreEqual(t.Count, 0); t.Clear(); Assert.AreEqual(t.Count, 0); t.Add("one", "one"); Assert.AreEqual(t.Count, 1); t.Clear(); Assert.AreEqual(t.Count, 0); }
private Trie data() { Trie t = new Trie(); t.Add("one", "one"); t[2] = "2"; t["~"] = "~"; t["a~"] = "a~"; t["~a"] = "~a"; t[' '] = " "; t[" "] = " "; Assert.AreEqual(t.Count, 7); Assert.IsTrue(t.Contains("~")); Assert.IsTrue(!t.Contains("~~")); return t; }
public TrieEnumerator(Trie t) { m_trie = t; m_pos.Push(m_trie.m_root); }
[Test] public void Test_Type() { Trie t = new Trie(); Assert.AreEqual("kixeye.bedrock.collections.Trie", t.GetType().FullName); }