yavsc/src/Yavsc.Org.Tests
Paul Schneider 9846210fd6
Some checks failed
Dotnet build and test / log-the-inputs (pull_request) Has been cancelled
Dotnet build and test / build (pull_request) Has been cancelled
ApplicationDbContext: drop redundant HasOne on 3 Client navs
LoadClientAsync(id) on ClientController used to trip an
IndexOutOfRangeException at the InMemory shaper for any
.Include() of one of three Client navs: RedirectUris,
AllowedScopes, AllowedGrantTypes. Five other Client navs (with
the same EF shape and the same application-level config) worked
fine.

Bisection pointed at the InMemory provider; that hypothesis was
wrong. The real cause is in ApplicationDbContext.OnModelCreating:
yavsc was redeclaring the HasOne<Client>().WithMany(...).
HasForeignKey(e => e.ClientId) for all eight Client* navs. The
same relation is already declared (more completely, with
.IsRequired().OnDelete(DeleteBehavior.Cascade)) by
IdentityServer8's ConfigureClientStore via ModelBuilderExtensions.

The redundant mapping on three specific entities — ClientScope,
ClientRedirectUri, ClientGrantType — interacts with the InMemory
provider's shaper in a way that throws IndexOutOfRange. Removing
the redundancy fixes it.

This commit also walks back b12c272d:
- Drops .AsSplitQuery() from LoadClientAsync (no longer needed
  for the InMemory shaper, and the Postgres path it was a hedge
  against was a false alarm — there is no Postgres production
  bug here, only an InMemory shaper quirk surfaced by the
  redundant mapping).
- Removes the 9 Bisect_*_alone tests that were the artefact of
  the provider-hypothesis phase. They pointed at the right
  entities but for the wrong reason.
- Keeps EditRedirectUris_GET_after_add_lists_both_uris as the
  end-to-end regression sentinel: with the fix in place, it
  loads a Client with two RedirectUris and asserts both are
  rendered. Without the fix, it fails with IndexOutOfRange.
2026-07-12 02:39:13 +01:00
..
Controllers ApplicationDbContext: drop redundant HasOne on 3 Client navs 2026-07-12 02:39:13 +01:00
Fakes Introduce Yavsc.Interfaces.ISmtpClient and a recording test fake 2026-06-22 02:09:02 +01:00
Mandatory refactoring 2026-06-19 19:59:15 +01:00
NonRegression Blog: add test guarding the display-template fix + document test architecture 2026-07-11 19:59:03 +01:00
Resources Relocate test project: test/yavscTests -> src/Yavsc.Org.Tests 2026-06-19 17:52:54 +01:00
Smoke tests: smoke tests for Account and Blog BCs 2026-06-27 21:03:16 +01:00
appsettings.json Relocate test project: test/yavscTests -> src/Yavsc.Org.Tests 2026-06-19 17:52:54 +01:00
ComputeKidTests.cs test(yavsc.org): cover the kid derivation in ComputeKid 2026-07-09 20:28:58 +01:00
Directory.Packages.props refactor: extract WebHostFixture + TestAuthPolicyProvider to shared lib 2026-07-06 21:33:57 +01:00
DumpHtml.cs refactoring 2026-06-19 19:59:15 +01:00
EstimateSignatureFileHelperTests.cs feat(api): POST /api/bill/estimate/{id}/sign — JSON signature capture 2026-07-04 15:47:55 +01:00
StaticAssetsPathsTests.cs fix(client-controller): single constructor with IHtmlLocalizer 2026-06-21 21:14:20 +01:00
test.runsettings fix(client-controller): single constructor with IHtmlLocalizer 2026-06-21 21:14:20 +01:00
TestUserMiddleware.cs refactor: extract WebHostFixture + TestAuthPolicyProvider to shared lib 2026-07-06 21:33:57 +01:00
TestUserStartupFilter.cs test(client): refactor InjectTestUser as a real IMiddleware 2026-06-21 21:24:44 +01:00
TestWebApplicationFactory.cs Revert "repoduces the bug" 2026-07-11 22:17:58 +01:00
WebServerFixture.cs Revert "repoduces the bug" 2026-07-11 22:17:58 +01:00
xunit.runner.json Relocate test project: test/yavscTests -> src/Yavsc.Org.Tests 2026-06-19 17:52:54 +01:00
Yavsc.Org.Tests.csproj Revert "repoduces the bug" 2026-07-11 22:17:58 +01:00