Exemple #1
0
        public void Add_Multiple_Words_Get_Possible_Results()
        {
            DictionaryTree dict = new DictionaryTree();

            dict.addWords(new string[] { "word", "words", "john", "joan", "art" });
            CollectionAssert.AreEqual(dict.getPossibleWords("wo"), new string[] { "word", "words" });
        }
Exemple #2
0
        public void Add_Multiple_Words_Word_Does_Not_Exist()
        {
            DictionaryTree dict = new DictionaryTree();

            dict.addWords(new string[] { "word", "words", "john", "joan", "art" });
            Assert.IsFalse(dict.isWord("henry"));
        }
Exemple #3
0
        public void Add_Word_Check_If_Partial_Word_Does_Not_Exist()
        {
            DictionaryTree dict = new DictionaryTree();

            dict.addWords(new string[] { "word" });
            Assert.IsFalse(dict.isWord("wo"));
        }
Exemple #4
0
        public void Add_Multiple_Words_Secondary_Word_Exists()
        {
            DictionaryTree dict = new DictionaryTree();

            dict.addWords(new string[] { "word", "words", "john", "joan", "art" });
            Assert.IsTrue(dict.isWord("words"));
        }
Exemple #5
0
        public void Add_Word_Word_Exists()
        {
            DictionaryTree dict = new DictionaryTree();

            dict.addWords(new string[] { "word" });
            Assert.IsTrue(dict.isWord("word"));
        }