feat(AuthClientTests): StartAsync_ShouldUpdateAllPublicKey Testmethode hinzufügen, um zu testen, ob der öffentliche Schlüssel nach StartAsync aktualisiert wird
This commit is contained in:
parent
e925c175a0
commit
4e941ed35f
@ -42,5 +42,5 @@ public class ClientParams
|
||||
});
|
||||
}
|
||||
|
||||
public IEnumerable<AsymmetricPublicKey> PublicKeys { get; init; } = new List<AsymmetricPublicKey>();
|
||||
public List<AsymmetricPublicKey> PublicKeys { get; init; } = new();
|
||||
}
|
||||
@ -185,4 +185,28 @@ public class AuthClientTests
|
||||
Assert.That(publicKey, Is.EqualTo(expectedPublicKey));
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task StartAsync_ShouldUpdateAllPublicKey()
|
||||
{
|
||||
// Arrange
|
||||
var publicKey = new AsymmetricPublicKey() { Issuer = "Foo", Audience = "Bar" };
|
||||
var provider = Build(opt =>
|
||||
{
|
||||
opt.Url = _hubUrl;
|
||||
opt.PublicKeys.Add(new AsymmetricPublicKey() { Issuer = "Foo", Audience = "Bar" });
|
||||
});
|
||||
var client = provider.GetRequiredService<IAuthClient>();
|
||||
await client.StartAsync();
|
||||
|
||||
// wait for network
|
||||
await Task.Delay(2000);
|
||||
|
||||
// Act
|
||||
var expectedPublicKey = _tokenDescriptors.Get("Foo", "Bar").PublicKey;
|
||||
await client.GetPublicKeyAsync("Foo", "Bar");
|
||||
|
||||
// Assert
|
||||
Assert.That(publicKey.Content, Is.EqualTo(expectedPublicKey.Content));
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user