示例#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" });
        }
示例#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"));
        }
示例#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"));
        }
示例#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"));
        }
示例#5
0
        public void Add_Word_Word_Exists()
        {
            DictionaryTree dict = new DictionaryTree();

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