Esempio n. 1
0
        public void canConsumerClassEncryptWithNullKey()
        {
            string key = null;

            StringCipherConsumer cipher = new StringCipherConsumer(key);

            string value = "David";

            string encryptedString = cipher.Encrypt(value);

            Assert.AreNotEqual(value, encryptedString);
        }
Esempio n. 2
0
        public void canConsumerClassDecrypt()
        {
            string key = "Allan";

            StringCipherConsumer cipher = new StringCipherConsumer(key);

            string value = "David";

            string encryptedString = cipher.Encrypt(value);

            string decryptedString = cipher.Decrypt(encryptedString);

            Assert.AreEqual(value, decryptedString);
        }