public void ForwardThenInverseShiftProducesSimilarTextWithUnknownLetters() { var plaintext = "this is a secret message"; var shifter = new CaesarShifter(); var shiftedText = shifter.Shift(plaintext, LetterSet.LowerCaseLatin, 3); var unshiftedText = shifter.Shift(shiftedText, LetterSet.LowerCaseLatin, 23); Assert.AreEqual(plaintext, unshiftedText); }
public void ShiftByNegativeNumberShiftsViaMoulus() { var plaintext = "this is a secret message"; var expected = "wklv lv d vhfuhw phvvdjh"; var shifter = new CaesarShifter(); var shiftedText = shifter.Shift(plaintext, LetterSet.LowerCaseLatin, -23); Assert.AreEqual(expected, shiftedText); }
public void ShiftWithUnkownCharactersLeavesThemInvariant() { var plaintext = "this is a secret message."; var expected = "wklv lv d vhfuhw phvvdjh."; var shifter = new CaesarShifter(); var shiftedText = shifter.Shift(plaintext, LetterSet.LowerCaseLatin, 3); Assert.AreEqual(expected, shiftedText); }
public void WellKnownCaesarShiftProducesWellKnownResult() { var plaintext = "this is a secret message"; var expected = "wklv lv d vhfuhw phvvdjh"; var shifter = new CaesarShifter(); var shiftedText = shifter.Shift(plaintext, LetterSet.LowerCaseLatin, 3); Assert.AreEqual(expected, shiftedText); }