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); }
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()); }
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()); }