public void TestDecodeStringNullSecretValue() { var secretValue = new GetSecretValueResponse(); string secret = GetSecretValue.DecodeString(secretValue); Assert.True(secret == string.Empty); }
public void TestDecodeStringStringValue() { var secretValue = new GetSecretValueResponse { SecretString = "Example Secret" }; string secret = GetSecretValue.DecodeString(secretValue); Assert.True(secret == "Example Secret"); }
public void TestDecodeStringBinaryValue() { var base64 = Convert.ToBase64String(Encoding.UTF8.GetBytes("SecretExample")); var secretBinary = new MemoryStream(Encoding.UTF8.GetBytes(base64)); var secretValue = new GetSecretValueResponse { SecretBinary = secretBinary, }; string secret = GetSecretValue.DecodeString(secretValue); Assert.True(secret == "SecretExample", $"secret value is {secret}."); }