public void DecryptString_ThrowsException_WhenIncorrectPassPhraseIsUsed() { const string text = "100% fluffy goodness"; var phrase = StringCipher.CreateRandomKey(); var cipher = StringCipher.EncryptString(text, phrase); var newPhrase = StringCipher.CreateRandomKey(); Assert.Throws <CryptographicException>( () => StringCipher.DecryptString(cipher, newPhrase)); }