Exemple #1
0
        public static void WhenProvidedAListOfWordsReturnAllWordChains()
        {
            var input = "mat";
            IAvailableWordFinder wordFinder = new AvailableWordFinder();
            IWordProvider        provider   = new WordProvider();
            var words = provider.GetWords("testwordlist.txt", input.Length);

            string[] expected = { "cat", "hat" };
            var      actual   = wordFinder.FindAllAvailableWords(input, words);

            Assert.Equal(expected, actual);
        }
Exemple #2
0
        public static void WhenProvidedAnInputWithNoMatchesReturnAnEmptyString()
        {
            var input = "Something";
            IAvailableWordFinder wordFinder = new AvailableWordFinder();
            IWordProvider        provider   = new WordProvider();
            var words = provider.GetWords("testwordlist.txt", input.Length);

            string[] expected = { };
            var      actual   = wordFinder.FindAllAvailableWords(input, words);

            Assert.Equal(expected, actual);
        }