public void TrieTest_AddSeveralFindWild2() { ITrie trie = new TrieWithNoChildren(); trie = trie.Add("bat"); trie = trie.Add("ball"); Assert.That(trie.WildcardSearch("b?t?"), Is.False); }
public void TestCAddEmptyAndShortWordLookUpEmpty() { ITrie t = new TrieWithNoChildren(); t = t.Add(""); t = t.Add("i"); Assert.That(t.Contains(""), Is.True); }
public void TestFAddDifferentLetterCheckType() { ITrie t = new TrieWithNoChildren(); t = t.Add("i"); t = t.Add("ice"); t = t.Add("cream"); Assert.That(t, Is.TypeOf(typeof(TrieWithManyChildren))); }
public void TrieTest_AddSeveralFindWild4() { ITrie trie = new TrieWithNoChildren(); trie = trie.Add("banana"); trie = trie.Add("balloon"); trie = trie.Add("banter"); Assert.That(trie.WildcardSearch("b?n?n?"), Is.True); }
public void TrieTest_AddSeveralFindWild3() { ITrie trie = new TrieWithNoChildren(); trie = trie.Add("bat"); trie = trie.Add("ball"); trie = trie.Add("sale"); Assert.That(trie.WildcardSearch("?a?e"), Is.True); }
public void TestFAddEmptyAndDifferentLetterLookUpEmpty() { ITrie t = new TrieWithNoChildren(); t = t.Add(""); t = t.Add("i"); t = t.Add("ice"); t = t.Add("cream"); Assert.That(t.Contains(""), Is.EqualTo(true)); }
public void TestELookupAllPrefixes2() { ITrie t = new TrieWithNoChildren(); t = t.Add("i"); t = t.Add("ice"); StringBuilder sb = new StringBuilder(); sb.Append(t.Contains("")); sb.Append(t.Contains("i")); sb.Append(t.Contains("ic")); sb.Append(t.Contains("ice")); Assert.That(sb.ToString(), Is.EqualTo("FalseTrueFalseTrue")); }
public void TestFAddDifferentLetterLookUpAll() { ITrie t = new TrieWithNoChildren(); t = t.Add("i"); t = t.Add("ice"); t = t.Add("cream"); StringBuilder sb = new StringBuilder(); sb.Append(t.Contains("")); sb.Append(t.Contains("i")); sb.Append(t.Contains("ice")); sb.Append(t.Contains("cream")); Assert.That(sb.ToString, Is.EqualTo("FalseTrueTrueTrue")); }
public void TestBAddEmptyLookItUp() { ITrie t = new TrieWithNoChildren(); t = t.Add(""); Assert.That(t.Contains(""), Is.True); }
public void TestBAddEmptyCheckType() { ITrie t = new TrieWithNoChildren(); t = t.Add(""); Assert.That(t, Is.TypeOf(typeof(TrieWithNoChildren))); }
public void TestDAddWordLookUpPrefix() { ITrie t = new TrieWithNoChildren(); t = t.Add("word"); Assert.That(t.Contains("wo"), Is.False); }
public void TestDAddLongWordLookItUp() { ITrie t = new TrieWithNoChildren(); t = t.Add("word"); Assert.That(t.Contains("word"), Is.True); }
public void TrieTest_AddTwoOneWild() { ITrie trie = new TrieWithNoChildren(); trie = trie.Add("an"); Assert.That(trie.WildcardSearch("?"), Is.False); }
/// <summary> /// Gets a trie of names /// </summary> /// <param name="names">a dictionary used to create the trie</param> /// <returns>the trie created</returns> public static ITrie GetNamesTrie(Dictionary <string, List <Employee> > names) { ITrie trie = new TrieWithNoChildren(); foreach (string s in names.Keys) { trie = trie.Add(s); } return(trie); }
public void TestBAddInvalid2() { Exception e = null; ITrie t = new TrieWithNoChildren(); try { t = t.Add("{"); } catch (Exception ex) { e = ex; } Assert.That(e, Is.Not.Null.And.TypeOf(typeof(ArgumentException))); }
public void TestCAddShortWordCheckType() { ITrie t = new TrieWithNoChildren(); t = t.Add("i"); }