Пример #1
0
        public void EncryptionTest_Reverse()
        {
            int    key        = 3;
            string PlainText  = "The quick brown fox jumps over the lazy dogs";
            string CipherText = CaesarCipher.CharShift(PlainText, key);

            System.Console.WriteLine(PlainText);
            System.Console.WriteLine(CipherText);
            System.Console.WriteLine(CaesarCipher.CharShift(CipherText, -key));
            System.Console.WriteLine(PlainText.ToUpper());

            Assert.AreEqual(PlainText.ToUpper(), CaesarCipher.CharShift(CipherText, -key));
        }
Пример #2
0
 public void EncryptionTest_1()
 {
     Assert.AreEqual("JCRRA", CaesarCipher.CharShift("Happy", 2));
     Assert.AreEqual("HAPPY", CaesarCipher.CharShift("JCRRA", -2));
 }