示例#1
0
        public void TestDecodeStringNullSecretValue()
        {
            var    secretValue = new GetSecretValueResponse();
            string secret      = GetSecretValue.DecodeString(secretValue);

            Assert.True(secret == string.Empty);
        }
示例#2
0
        public void TestDecodeStringStringValue()
        {
            var secretValue = new GetSecretValueResponse
            {
                SecretString = "Example Secret"
            };

            string secret = GetSecretValue.DecodeString(secretValue);

            Assert.True(secret == "Example Secret");
        }
示例#3
0
        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}.");
        }