Exemple #1
0
        public void Test003_HelperMethod002_GivenWordSearch_GetRowsInWordSearchReturnsAListOfStringsEachContainingARowFromThePuzzle()
        {
            WordSearch wordSearch = new WordSearch();

            string input = wordSearch.GetInput("TestDocument001.txt");

            List <string> expectedResult = new List <string>(new string[] { "BVLTW", "XVSOO", "SEEKR", "TPWXD", "KTESD" });
            List <string> actualResult   = wordSearch.GetRowsInWordSearch(input);

            CollectionAssert.AreEqual(expectedResult, actualResult);

            // ---------------------------------------------------------------------------------------------------------------

            input = wordSearch.GetInput("TestDocument002.txt");

            expectedResult = new List <string>(new string[] { "LTCTVLH", "DDSLSQK", "FUTESTO", "JITXYSC", "SHLYWIN", "EMLEAHJ", "QIRKSTI" });
            actualResult   = wordSearch.GetRowsInWordSearch(input);

            CollectionAssert.AreEqual(expectedResult, actualResult);
        }
Exemple #2
0
        public void Test007_HelperMethod001_GivenWordSearch_GetUpwardDiagonalsInWordSearchReturnsAListOfStringsEachContainingADiagonalFromThePuzzle()
        {
            WordSearch wordSearch = new WordSearch();

            string input = wordSearch.GetInput("TestDocument001.txt");

            List <string> expectedResult = new List <string>(new string[] { "B", "XV", "SVL", "TEST", "KPEOW", "TWKO", "EXR", "SD", "D" });
            List <string> actualResult   = wordSearch.GetUpwardDiagonalsInWordSearch(wordSearch.GetRowsInWordSearch(input));

            CollectionAssert.AreEqual(expectedResult, actualResult);
        }
Exemple #3
0
        public void Test008_HelperMethod001_GivenWordSearch_GetDownwardDiagonalsInWordSearchReturnsAListOfStringsEachContainingADiagonalFromThePuzzle()
        {
            WordSearch wordSearch = new WordSearch();

            string input = wordSearch.GetInput("TestDocument002.txt");

            List <string> expectedResult = new List <string>(new string[] { "H", "LK", "VQO", "TSTC", "CLSSN", "TSEYIJ", "LDTXWHI", "DUTYAT", "FILES", "JHLK", "SMR", "EI", "Q" });
            List <string> actualResult   = wordSearch.GetDownwardDiagonalsInWordSearch(wordSearch.GetRowsInWordSearch(input));

            CollectionAssert.AreEqual(expectedResult, actualResult);
        }