Skip to content

test: raise coverage above 95% via auth callback and AddTraxGraphQL tests#44

Merged
Theauxm merged 1 commit into
mainfrom
test/raise-coverage-above-95
May 6, 2026
Merged

test: raise coverage above 95% via auth callback and AddTraxGraphQL tests#44
Theauxm merged 1 commit into
mainfrom
test/raise-coverage-above-95

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented May 6, 2026

Summary

  • Direct invocation tests for OIDC and JWT OnTokenValidated handlers (null principal, no resolver, resolver returns null, resolver throws, success path, outer-handler short-circuit). The existing tests only checked the events were wired.
  • Direct tests for the OIDC cookie OnRedirectToLogin and OnRedirectToAccessDenied handlers (401 / 403 instead of redirects to /Account/Login).
  • Coverage for AddTraxGraphQL guard (throws when AddTrax was not called), custom AddTypeModule<T>() registration through the reflection foreach, RequireAuthorization wiring of the policy validator and request interceptor, and UseTraxGraphQL endpoint mapping with and without an endpoint configurator.

Local cobertura: 93.63% to 95.96% across the project.

Test plan

  • dotnet test clean (782 passed, 1 pre-existing skipped)
  • dotnet build zero warnings
  • dotnet csharpier format . applied
  • Cobertura aggregate >= 95.5%

Adds direct unit tests for the OIDC and JWT OnTokenValidated event handlers
(null principal, missing resolver, resolver throws, resolver returns null,
short-circuit when an outer handler already set Result) plus the OIDC cookie
401/403 redirect handlers. Also covers AddTraxGraphQL's AddTrax guard, custom
TypeModule registration, RequireAuthorization wiring, and UseTraxGraphQL
endpoint mapping with and without an endpoint configurator.
@Theauxm Theauxm merged commit 4f6870e into main May 6, 2026
1 check passed
@Theauxm Theauxm deleted the test/raise-coverage-above-95 branch May 6, 2026 17:00
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented May 8, 2026

This PR is included in version 1.25.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant