Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
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;
 }