Skip to content

Commit

Permalink
[release/2.1] Credentials fix
Browse files Browse the repository at this point in the history
- inspired by dotnet/runtime#50230
- cherry-picked from 1594096
  • Loading branch information
dougbu committed Apr 8, 2021
1 parent c5360b7 commit bb01c8d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ public void AddUserSecrets_DoesNotThrowsIfOptional()
public void AddUserSecrets_With_SecretsId_Passed_Explicitly()
{
var userSecretsId = Guid.NewGuid().ToString();
SetSecret(userSecretsId, "Facebook:AppSecret", "value1");
SetSecret(userSecretsId, "Facebook:PLACEHOLDER", "value1");

var builder = new ConfigurationBuilder().AddUserSecrets(userSecretsId);
var configuration = builder.Build();

Assert.Equal("value1", configuration["Facebook:AppSecret"]);
Assert.Equal("value1", configuration["Facebook:PLACEHOLDER"]);
}

[Fact]
Expand All @@ -125,7 +125,7 @@ public void AddUserSecrets_Does_Not_Fail_On_Non_Existing_File()
var builder = new ConfigurationBuilder().AddUserSecrets(userSecretsId);

var configuration = builder.Build();
Assert.Null(configuration["Facebook:AppSecret"]);
Assert.Null(configuration["Facebook:PLACEHOLDER"]);
Assert.False(File.Exists(secretFilePath));
}

Expand Down

0 comments on commit bb01c8d

Please sign in to comment.