public void TestSingularAddToTree() { string text = "content"; CityTreeNode tree = new CityTreeNode(); tree.Add(text); string result = tree.GetEntries(1)[0]; Assert.AreEqual(result, text); }
public void TestInvalidLetterSuggestions() { List <string> text = new List <string>(new string[] { "abcdef", "abd", "acdef" }); CityTreeNode tree = new CityTreeNode(); text.ForEach(content => tree.Add(content)); string search = "z"; List <string> nextLetters = tree.GetNextLetters(search); CollectionAssert.AreEqual(new List <string>(), nextLetters); }
public void TestMultipleAddToTree() { List <string> text = new List <string>(new string[] { "content", "john smith", "test" }); CityTreeNode tree = new CityTreeNode(); text.ForEach(content => tree.Add(content)); List <string> results = tree.GetEntries(3); foreach (string result in results) { Assert.AreEqual(true, text.Contains(result)); } }