public void VigenereDencrypt_CorrectData_ReturnList()
        {
            var text = new string[] { "aiDEHa ohkpv!", "aideha ohkpv!" };
            var key  = "test";

            var result = vigenere.Dencrypt(text, key);

            result.Should().Contain("hellow world!");
        }
示例#2
0
        public void Decrypt(string source, string key, string expected)
        {
            var    crypto = new Vigenere();
            string actual = crypto.Dencrypt(source, key);

            Assert.AreEqual(expected, actual);
        }
示例#3
0
        public void DencryptEnumerable(string[] sources, string key, string[] expected)
        {
            var crypto = new Vigenere();

            string[] actual = crypto.Dencrypt(sources, key).ToArray();

            Assert.AreEqual(expected, actual);
        }
示例#4
0
        public void EncryptDencryptTest()
        {
            string source = "ФРАЗА ДЛЯ ТЕСТА";
            string key = "КЛЮЧ";
            string encrypted, dencrypted;

            Vigenere v = new Vigenere();

            encrypted  = v.Encrypt(source, key);
            dencrypted = v.Dencrypt(encrypted, key);


            Assert.AreEqual(source, dencrypted);
        }