public void MultiwordPuzzleWithNoSolution() { // Arrange string plaintext = "No solution could ever possibly be found"; string cryptogram = EncodeByShifting(plaintext, 4); var dictionary = GetDictionaryFor("a completely different sentence"); // Act string actual = CryptogramSolver.Solve(cryptogram, dictionary); // Assert Assert.AreEqual(string.Empty, actual); }
public void MultiwordPuzzleWithSolution() { // Arrange string expected = "the quick red fox jumps over the lazy brown dog"; string cryptogram = EncodeByShifting(expected, 3); var dictionary = GetDictionaryFor(expected); // Act string actual = CryptogramSolver.Solve(cryptogram, dictionary); // Assert Assert.AreEqual(expected, actual); }
public void PuzzleWithPunctuationAndSentenceCasing() { // Arrange string expected = "'Hello, world!'"; string cryptogram = EncodeByShifting(expected, 10); string[] dictionary = { "hello", "world" }; // Act string actual = CryptogramSolver.Solve(cryptogram, dictionary); // Assert Assert.AreEqual(expected, actual); }