//[Ignore("Takes more than 3 seconds.")] //needed for coverage public void CreatesExpectedPuzzle() { ReadDownColumnPuzzle puzzle = new ReadDownColumnPuzzle { Solution = "cat" }; puzzle.PopulateWords(); int currentIndex = 0; foreach (string word in puzzle.Words) { Console.WriteLine(puzzle.Words[currentIndex]); Assert.AreEqual(puzzle.Solution[currentIndex], word[2], $"Expected character at index {currentIndex}"); currentIndex++; } }
public void SpecialCharacter_IncludedInEachWord() { ReadDownColumnPuzzle puzzle = new ReadDownColumnPuzzle { RandomSeed = 42, SpecialCharacter = 'M', Solution = "claw", NumberOfWordsToInclude = 1 }; puzzle.PopulateWords(); foreach (string word in puzzle.Words) { if (word == "lowing") { continue; //not sure why "mowing" isn't a word. } StringAssert.Contains("m", word, "Expected the letter 'm' in each word."); } }
public void SpacesInPhrase_CreatesExpectedPuzzle() { ReadDownColumnPuzzle puzzle = new ReadDownColumnPuzzle { Solution = "cats and dogs" }; var puzzleSolution = "catsAndDogs".ToLowerInvariant(); puzzle.PopulateWords(); int currentIndex = 0; foreach (string word in puzzle.Words) { Console.WriteLine(puzzle.Words[currentIndex]); Assert.AreEqual(puzzleSolution[currentIndex], word[2], $"Expected character at index {currentIndex}"); currentIndex++; } }