Пример #1
0
        public void AesCryptography_ShouldDecryptInputAsExpected_WhenInputIsValid()
        {
            // Arrange
            const string valueToDecrypt = "JunvToRuNjpHAhSKVECm9w==:ZsxfZgMpNEo=";
            const string expectedResult = "encrypt";

            // Act
            string decryptedValue = CUT.Decrypt(valueToDecrypt);

            // Assert
            decryptedValue.ShouldBe(expectedResult);
            decryptedValue.ShouldNotBe(valueToDecrypt);

            // Print
            WriteLine(decryptedValue);
        }
Пример #2
0
        public void AesCryptography_ShouldEncryptInputAsExpected_WhenInputIsValid()
        {
            // Arrange
            const string valueToEncrypt = "encrypt";

            // Act
            string encryptedValue = CUT.Encrypt(valueToEncrypt);
            string decryptedValue = CUT.Decrypt(encryptedValue);

            // Assert
            encryptedValue.ShouldNotBe(valueToEncrypt);
            decryptedValue.ShouldBe(valueToEncrypt);

            // Print
            WriteLine(encryptedValue);
        }