Exemplo n.º 1
0
        public void RoundTripEncryptNullStringTest()
        {
            ICipherTasks target   = GetCipher();
            string       testText = null;

            var cryptoResult = target.Encrypt(testText);

            Assert.IsNull(cryptoResult);

            target = GetCipher();

            var textResult = target.DecryptString(cryptoResult);

            Assert.AreEqual(testText, textResult);
        }
Exemplo n.º 2
0
        public void RoundTripEncryptStringTest()
        {
            ICipherTasks target   = GetCipher();
            var          testText = "test text";

            var cryptoResult = target.Encrypt(testText);

            Assert.IsNotNull(cryptoResult);
            Assert.IsTrue(cryptoResult.Length > testText.Length * 2);

            target = GetCipher();

            var textResult = target.DecryptString(cryptoResult);

            Assert.AreEqual(testText, textResult);
        }