public void WithPunctuation_ReturnsExpectedString() { WordPuzzles.Puzzle.InnerAnacrosticPuzzle puzzle = new WordPuzzles.Puzzle.InnerAnacrosticPuzzle { PhraseAsString = "i'm x." }; puzzle.AddWordToClues("mix"); puzzle.PlaceLetters(); HtmlGenerator htmlGenerator = new HtmlGenerator { Puzzle = puzzle }; const string EXPECTED_HTML = @"<tr> <td colspan=""2""> <input type=""text"" size=""1"" maxlength=""1"" id=""letter3"" onFocus=""colorMeAndMyMatch(3,'yellow');"" onBlur=""colorMeAndMyMatch(3,'white');"" /> ' <input type=""text"" size=""1"" maxlength=""1"" id=""letter4"" onFocus=""colorMeAndMyMatch(4,'yellow');"" onBlur=""colorMeAndMyMatch(4,'white');"" /> <input type=""text"" size=""1"" maxlength=""1"" id=""letter5"" onFocus=""colorMeAndMyMatch(5,'yellow');"" onBlur=""colorMeAndMyMatch(5,'white');"" /> . </td> </tr> "; Assert.AreEqual(EXPECTED_HTML, htmlGenerator.CreateTableRowForPhrase()); }
public void ReturnsExpectedResult() { HtmlGenerator generator = new HtmlGenerator(); WordPuzzles.Puzzle.InnerAnacrosticPuzzle puzzle = new WordPuzzles.Puzzle.InnerAnacrosticPuzzle { PhraseAsString = "max peel" }; puzzle.AddWordToClues("example"); puzzle.PlaceLetters(); generator.Puzzle = puzzle; const string EXPECTED_HTML = @"<tr> <td colspan=""2""> <input type=""text"" size=""1"" maxlength=""1"" id=""letter7"" onFocus=""colorMeAndMyMatch(7,'yellow');"" onBlur=""colorMeAndMyMatch(7,'white');"" /><input type=""text"" size=""1"" maxlength=""1"" id=""letter8"" onFocus=""colorMeAndMyMatch(8,'yellow');"" onBlur=""colorMeAndMyMatch(8,'white');"" /><input type=""text"" size=""1"" maxlength=""1"" id=""letter9"" onFocus=""colorMeAndMyMatch(9,'yellow');"" onBlur=""colorMeAndMyMatch(9,'white');"" /> <input type=""text"" size=""1"" maxlength=""1"" id=""letter10"" onFocus=""colorMeAndMyMatch(10,'yellow');"" onBlur=""colorMeAndMyMatch(10,'white');"" /><input type=""text"" size=""1"" maxlength=""1"" id=""letter11"" onFocus=""colorMeAndMyMatch(11,'yellow');"" onBlur=""colorMeAndMyMatch(11,'white');"" /><input type=""text"" size=""1"" maxlength=""1"" id=""letter12"" onFocus=""colorMeAndMyMatch(12,'yellow');"" onBlur=""colorMeAndMyMatch(12,'white');"" /><input type=""text"" size=""1"" maxlength=""1"" id=""letter13"" onFocus=""colorMeAndMyMatch(13,'yellow');"" onBlur=""colorMeAndMyMatch(13,'white');"" /> </td> </tr> "; Assert.AreEqual(EXPECTED_HTML, generator.CreateTableRowForPhrase()); }