diff --git a/tests/Bifrost.Web.Tests/OidcLogoutTests.cs b/tests/Bifrost.Web.Tests/OidcLogoutTests.cs index 3b37f21..ed9416e 100644 --- a/tests/Bifrost.Web.Tests/OidcLogoutTests.cs +++ b/tests/Bifrost.Web.Tests/OidcLogoutTests.cs @@ -13,7 +13,7 @@ namespace Bifrost.Web.Tests; public sealed class OidcLogoutTests { private static readonly TimeSpan[] ExpectedBackoff = - [30, 60, 120, 240, 480, 900, 900].Select(x => TimeSpan.FromSeconds(x)).ToArray(); + new[] { 30, 60, 120, 240, 480, 900, 900 }.Select(x => TimeSpan.FromSeconds(x)).ToArray(); [Fact] public async Task Probe_authorizations_carry_the_subject_and_a_valid_status_after_a_code_flow() diff --git a/tests/Bifrost.Web.Tests/Support/OidcLogoutKit.cs b/tests/Bifrost.Web.Tests/Support/OidcLogoutKit.cs index b04ded9..82872cc 100644 --- a/tests/Bifrost.Web.Tests/Support/OidcLogoutKit.cs +++ b/tests/Bifrost.Web.Tests/Support/OidcLogoutKit.cs @@ -4,6 +4,7 @@ using System.Net.Http.Json; using System.Security.Cryptography; using System.Text; using System.Text.Json; +using Bifrost.Web.Configuration; using Bifrost.Web.Data; using Bifrost.Web.Domain; using Bifrost.Web.Features.Oidc; @@ -136,7 +137,7 @@ public sealed class OidcLogoutFactory : OidcWebApplicationFactory Time, NullLogger.Instance); - public WebApplicationFactoryClientOptions ClientOptions() => new() + public WebApplicationFactoryClientOptions HostClientOptions() => new() { AllowAutoRedirect = false, HandleCookies = true, @@ -146,7 +147,7 @@ public sealed class OidcLogoutFactory : OidcWebApplicationFactory /// Registers a member, sets , and completes one authorization-code flow for them. public async Task<(string Identity, string IdToken)> GrantAsync(MembershipStatus status = MembershipStatus.Active) { - using var client = CreateClient(ClientOptions()); + using var client = CreateClient(HostClientOptions()); var identity = $"member-{Guid.NewGuid():N}"; using (var register = await client.PostAsJsonAsync("/auth/bifrost/register", new { identity, displayName = identity })) { @@ -174,7 +175,7 @@ public sealed class OidcLogoutFactory : OidcWebApplicationFactory var code = QueryHelpers.ParseQuery(response.Headers.Location!.Query)["code"].ToString(); response.Dispose(); - using var bare = CreateClient(ClientOptions()); + using var bare = CreateClient(HostClientOptions()); using var exchange = new HttpRequestMessage(HttpMethod.Post, "/connect/token") { Content = new FormUrlEncodedContent(new Dictionary @@ -215,7 +216,7 @@ public sealed class OidcLogoutFactory : OidcWebApplicationFactory public async Task JwksAsync() { - using var client = CreateClient(ClientOptions()); + using var client = CreateClient(HostClientOptions()); return new JsonWebKeySet(await client.GetStringAsync("/.well-known/jwks")); } }