Example #1
0
 public void Rotate_spaces()
 {
     Assert.Equal("T R L", RotationalCipher.Rotate("O M G", 5));
 }
Example #2
0
 public void Rotate_n_by_13_with_wrap_around_alphabet()
 {
     Assert.Equal("a", RotationalCipher.Rotate("n", 13));
 }
Example #3
0
 public void Rotate_capital_letters()
 {
     Assert.Equal("TRL", RotationalCipher.Rotate("OMG", 5));
 }
Example #4
0
 public void Rotate_a_by_1()
 {
     Assert.Equal("b", RotationalCipher.Rotate("a", 1));
 }
Example #5
0
 public void Rotate_m_by_13()
 {
     Assert.Equal("z", RotationalCipher.Rotate("m", 13));
 }
Example #6
0
 public void Rotate_all_letters()
 {
     Assert.Equal("Gur dhvpx oebja sbk whzcf bire gur ynml qbt.", RotationalCipher.Rotate("The quick brown fox jumps over the lazy dog.", 13));
 }
Example #7
0
 public void Rotate_ByOne_OutputIsNextCharacter()
 {
     Assert.AreEqual("b", RotationalCipher.Rotate("a", 1));
 }
Example #8
0
 public void Rotate_WithNumbers_OutputIsCorrect()
 {
     Assert.AreEqual("Xiwxmrk 1 2 3 xiwxmrk", RotationalCipher.Rotate("Testing 1 2 3 testing", 4));
 }
Example #9
0
 public void Rotate_WithPunctuation_OutputIsCorrect()
 {
     Assert.AreEqual("Gzo'n zvo, Bmviyhv!", RotationalCipher.Rotate("Let's eat, Grandma!", 21));
 }
Example #10
0
 public void Rotate_CapitalLetters_OutputIsCorrect()
 {
     Assert.AreEqual("TRL", RotationalCipher.Rotate("OMG", 5));
 }
Example #11
0
 public void Rotate_WithSpaces_OutputIsCorrect()
 {
     Assert.AreEqual("T R L", RotationalCipher.Rotate("O M G", 5));
 }
Example #12
0
 public void Rotate_PastEndOfAlphabet_WrapsAround()
 {
     Assert.AreEqual("a", RotationalCipher.Rotate("n", 13));
 }
Example #13
0
 public void Rotate_ByThirteen_OutputIsCorrect()
 {
     Assert.AreEqual("z", RotationalCipher.Rotate("m", 13));
 }
Example #14
0
 public void Rotate_ByTwentySix_OutputMatchesInput()
 {
     Assert.AreEqual("a", RotationalCipher.Rotate("a", 26));
 }
Example #15
0
 public void Rotate_numbers()
 {
     Assert.Equal("Xiwxmrk 1 2 3 xiwxmrk", RotationalCipher.Rotate("Testing 1 2 3 testing", 4));
 }
Example #16
0
 public void Rotate_WithEveryLetter_OutputIsCorrect()
 {
     Assert.AreEqual("Gur dhvpx oebja sbk whzcf bire gur ynml qbt.", RotationalCipher.Rotate("The quick brown fox jumps over the lazy dog.", 13));
 }
Example #17
0
 public void Rotate_punctuation()
 {
     Assert.Equal("Gzo'n zvo, Bmviyhv!", RotationalCipher.Rotate("Let's eat, Grandma!", 21));
 }
Example #18
0
 public void Rotate_ByZero_OutputMatchesInput()
 {
     Assert.AreEqual("a", RotationalCipher.Rotate("a", 0));
 }
Example #19
0
 public void Rotate_a_by_0_same_output_as_input()
 {
     Assert.Equal("a", RotationalCipher.Rotate("a", 0));
 }
Example #20
0
    public void Rotate_ShouldWork_WhenShiftKeyIsOutOfRange(string text, string expectedRotatedText, int shiftKey)
    {
        string actualRotatedText = RotationalCipher.Rotate(text, shiftKey);

        Assert.Equal(expectedRotatedText, actualRotatedText);
    }