public void FindWordsWhenMatchTheUnexistingLetters() { var wordList = new List <string>() { "AAAA", "AAAB", "ABAA" }; var wf = new WordsFinder(wordList); var letterA = new Letter(); letterA.Solve('A'); var letterMinusB = new Letter(); letterMinusB.DiscardPossibility('B'); var word = new Word(new List <Letter>() { letterA, letterA, letterA, letterMinusB }); var wordsSolutions = wf.GetWords(word); Assert.AreEqual(1, wordsSolutions.Count); }
public void FindWordsWhenMatchTheExistingLetters() { var wordList = new List <string>() { "AAAA", "AAAB", "ABAA" }; var wf = new WordsFinder(wordList); var letterA = new Letter(); letterA.Solve('A'); var letter = new Letter(); var word = new Word(new List <Letter>() { letterA, letterA, letterA, letter }); var wordsSolutions = wf.GetWords(word); Assert.AreEqual(2, wordsSolutions.Count); }
public void ReturnEmptyStringListWhenNoWordIsFound() { var wf = new WordsFinder(); var words = wf.GetWords(""); Assert.AreEqual(0, words.Count); }
public void ReturnOneWordWhenItMatchesTheFilter() { var wordList = new List <string>() { "word", "hello" }; var wf = new WordsFinder(wordList); var wordsSolutions = wf.GetWords("hello"); Assert.AreEqual(1, wordsSolutions.Count); }
public void ReturnOneWordWhenThereIsOneWordInDictionaryAndEmptyFilter() { var wordList = new List <string>() { "word" }; var wf = new WordsFinder(wordList); var words = wf.GetWords(""); Assert.AreEqual(1, words.Count); }
public void FindTwoWordsOfFourCharacters() { var wordList = new List <string>() { "WORD", "HELLO", "ABCD" }; var wf = new WordsFinder(wordList); var letter = new Letter(); var word = new Word(new List <Letter>() { letter, letter, letter, letter }); var wordsSolutions = wf.GetWords(word); Assert.AreEqual(2, wordsSolutions.Count); }