public void InsertWordsAndSearchForThemBySubstring5() { TrieBase trie = new TrieBase(); string word = "Bor"; string word01 = "YesPesho"; trie.Insert(word01); string word1 = "IskamPomo"; trie.Insert(word1); string word2 = "GoshoPesho"; trie.Insert(word2); string word3 = "GoshoPeshoVanio"; trie.Insert(word3); string word4 = "GoshoPeshoBore"; trie.Insert(word4); ICollection <string> results = trie.Search(word, SearchType.Substring); bool actual = results.Contains(word4); Assert.AreEqual(true, actual); }
public void InsertTwoWordsAndTestIfNotContainsWordTest() { TrieBase trie = new TrieBase(); string word = "GOSHO"; trie.Insert(word); string word2 = "GOSHO2"; trie.Insert(word2); bool actual = trie.Contains("HA"); Assert.AreEqual(false, actual); }
public void InsertTwoWordsAndTestIfContainsSecondWordTest() { TrieBase trie = new TrieBase(); string word = "GOSHO"; trie.Insert(word); string word2 = "GOSHO2"; trie.Insert(word2); bool actual = trie.Contains(word2); Assert.AreEqual(true, actual); }
public void InsertWordsAndSearchForThem() { TrieBase trie = new TrieBase(); string word = "Gosho"; trie.Insert(word); string word2 = "GoshoPesho"; trie.Insert(word2); ICollection <string> results = trie.Search(word); bool actual = results.Contains(word) && results.Contains(word2); Assert.AreEqual(true, actual); }
public void InserWordTest() { TrieBase trie = new TrieBase(); string word = "GOSHO"; trie.Insert(word); Assert.AreEqual('G', trie.Root.Children['G'].Value); }
public void InsertWordWithSpaceAndCheckIfNoContains() { TrieBase trie = new TrieBase(); string word = "GOSHO GOSHO"; trie.Insert(word); bool actual = trie.Contains("GOSHO"); Assert.AreEqual(true, actual); }
public void InsertNumbersAndCheckIfNoContains() { TrieBase trie = new TrieBase(); string word = "123"; trie.Insert(word); bool actual = trie.Contains("1234"); Assert.AreEqual(false, actual); }
public void CheckIfContainsWordTest() { TrieBase trie = new TrieBase(); string word = "GOSHO"; trie.Insert(word); bool actual = trie.Contains(word); bool expected = true; Assert.AreEqual(expected, actual); }
public void Insert(string key, T value) { InsertToDictionary(key.ToLower(), value); TrieBase.Insert(key.ToLower()); }