Path: redb-identity/tests/redb.Identity.Web.Tests/LoginEndpointTests.cs Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/tests/redb.Identity.Web.Tests/LoginEndpointTests.cs ---- using System.Net; using System.Net.Http; using AwesomeAssertions; using Microsoft.AspNetCore.Mvc.Testing; using Xunit; namespace redb.Identity.Web.Tests; public sealed class LoginEndpointTests : IClassFixture { private readonly WebHostFixture _factory; public LoginEndpointTests(WebHostFixture factory) { _factory = factory; } [Fact] public async Task Get_account_login_with_unreachable_authority_redirects_to_error() { var client = _factory.CreateClient(new WebApplicationFactoryClientOptions { AllowAutoRedirect = false }); var resp = await client.GetAsync("/account/login"); // OIDC discovery to 127.0.0.1:1 must fail → /account/login catches the // discovery exception and redirects the user to /Error?reason=oidc-discovery-failure // (or, if the catch doesn't match, the framework returns 500 — both are acceptable // proofs that the host correctly handles a downed Identity provider). resp.StatusCode.Should().BeOneOf( HttpStatusCode.Redirect, HttpStatusCode.Found, HttpStatusCode.SeeOther, HttpStatusCode.InternalServerError); } }