You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(#1695): cover identity-form vs username branching in ResolveHumanGuidAsync (#1711)
The PermissionService fix landed in PR #1691 as one of several changes; #1695
remained open because the test coverage that locks in the regression behaviour
hadn't followed. This adds the four facts the issue called for so the bug
cannot silently come back:
- ResolveHumanGuidAsync_IdentityFormGuid_ResolvesDirectly: 32-hex "N" form
short-circuits, IHumanIdentityResolver is never invoked.
- ResolveHumanGuidAsync_IdentityFormGuid_DashedForm_ResolvesDirectly:
GuidFormatter.TryParse accepts both "N" and "D" forms, so dashed callers
also bypass the resolver.
- ResolveHumanGuidAsync_LegacyUsername_FallsThroughToResolver: legacy
username-form callers (e.g. local-dev-user) still hit the resolver and
the upsert-on-first-contact path is preserved.
- ResolveHumanGuidAsync_IdentityForm_DoesNotCreatePhantomRow: regression
test against the spring.humans phantom-row symptom — asserts
ResolveByUsernameAsync is never invoked across both identity-form
shapes, which is what guarantees the resolver's upsert-on-miss can no
longer create a phantom row keyed by GUID-hex.
Tests inject a real ServiceCollection-backed IServiceScopeFactory so the
service exercises the production scope-resolution path and the substituted
IHumanIdentityResolver records every call (matching the pattern used in
UnitCreationServiceTests).
Closes#1695.
Co-authored-by: savasp-agent[bot] <275188714+savasp-agent[bot]@users.noreply.github.com>
0 commit comments