コード例 #1
0
        public async Task GetSecretValue_Returns_String()
        {
            // Arrange
            var uri      = new Uri("https://aka.ms");
            var provider = new AzureKeyVaultSecretProvider(uri);

            // Act
            var secret = await provider.GetSecretValueAsync("key");

            // Assert
            Assert.IsNotNull(secret);
        }
コード例 #2
0
        public async Task GetSecretValue_Returns_Secret()
        {
            // Arrange
            var uri           = new Uri("https://aka.ms");
            var expectedValue = "open sesame!";
            var provider      = new AzureKeyVaultSecretProvider(uri);

            // Act
            var secret = await provider.GetSecretValueAsync("key");

            // Assert
            Assert.IsNotNull(secret);
            Assert.AreEqual(expectedValue, secret.ToString());
        }
コード例 #3
0
        public async Task GetSecretValueUsingConnectionString_Returns_Secret()
        {
            // Arrange
            var expectedValue = "open sesame!";

            var uri      = new Uri("");
            var tenantId = "";
            var clientId = "";
            var appKey   = "";
            var provider = new AzureKeyVaultSecretProvider(uri, tenantId, clientId, appKey);

            // Act
            var secret = await provider.GetSecretValueAsync("key");

            // Assert
            Assert.IsNotNull(secret);
            Assert.AreEqual(expectedValue, secret.ToString());
        }