public void RoundTripEncryptNullGenericStringTest() { ICipherTasks target = GetCipher(); string testText = null; var cryptoResult = target.Encrypt <string>(testText); Assert.IsNull(cryptoResult); target = GetCipher(); var textResult = target.Decrypt <string>(cryptoResult); Assert.AreEqual(testText, textResult); }
public void RoundTripEncryptNullTypedStringTest() { ICipherTasks target = GetCipher(); string testText = null; var cryptoResult = target.Encrypt(testText, typeof(string)); Assert.IsNull(cryptoResult); target = GetCipher(); var textResult = target.Decrypt(cryptoResult, typeof(string)); Assert.AreEqual(testText, textResult); }
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); }
public void RoundTripEncryptGenericEmptyStringTest() { ICipherTasks target = GetCipher(); var testText = string.Empty; var cryptoResult = target.Encrypt <string>(testText); Assert.IsNotNull(cryptoResult); Assert.IsTrue(cryptoResult.Length > testText.Length * 2); target = GetCipher(); var textResult = target.Decrypt <string>(cryptoResult); Assert.AreEqual(testText, textResult); }