public void AddSigningCertificate_SigningKeyIsCorrectlyAdded() { // Arrange var services = CreateServices(); var builder = new OpenIddictBuilder(services); // Act builder.AddSigningCertificate( assembly: typeof(OpenIddictExtensionsTests).GetTypeInfo().Assembly, resource: "OpenIddict.Tests.Certificate.pfx", password: "******"); var options = GetOptions(services); // Assert Assert.IsType <X509SecurityKey>(options.SigningCredentials[0].Key); }
public void AddSigningCertificate_SigningKeyIsCorrectlyAdded() { // Arrange var services = new ServiceCollection(); services.AddOptions(); var builder = new OpenIddictBuilder(services); // Act builder.AddSigningCertificate( assembly: typeof(OpenIddictBuilderTests).GetTypeInfo().Assembly, resource: "OpenIddict.Tests.Certificate.pfx", password: "******"); var provider = services.BuildServiceProvider(); var options = provider.GetRequiredService <IOptions <OpenIddictOptions> >(); // Assert Assert.IsType(typeof(X509SecurityKey), options.Value.SigningCredentials[0].Key); }