test(identity): add handler tests for auth-critical flows#1204
Merged
iammukeshm merged 3 commits intodevelopfrom Feb 2, 2026
Merged
test(identity): add handler tests for auth-critical flows#1204iammukeshm merged 3 commits intodevelopfrom
iammukeshm merged 3 commits intodevelopfrom
Conversation
- Added GenerateTokenCommandHandler tests (login flow) - Added RefreshTokenCommandHandler tests (token refresh) - Added RegisterUserCommandHandler tests (user registration) - Added RevokeSessionCommandHandler tests (session management) - Added ChangePasswordCommandHandler tests (password change) Tests include: - Happy path scenarios - Invalid input handling (null checks) - Exception scenarios - CancellationToken propagation - Edge cases and error conditions Following existing test patterns from Multitenancy module: - Uses xUnit, Shouldly, NSubstitute, AutoFixture - Arrange/Act/Assert pattern - Comprehensive test coverage per handler Addresses issue #1173
2 tasks
added 2 commits
February 2, 2026 05:25
- Added using NSubstitute.ExceptionExtensions to: - RevokeSessionCommandHandlerTests.cs - ChangePasswordCommandHandlerTests.cs - GenerateTokenCommandHandlerTests.cs - RegisterUserCommandHandlerTests.cs - Fixed IIntegrationEvent type in outboxStore assertions
- Make ConfigureRecipients and CreateBasicClaims static (CA1822) - Cache JsonSerializerOptions in VersionCommand (CA1869) - Delete unused TemplateEngineTests.cs debug file - Add NoWarn for false-positive warnings in CLI project: - CA1812: Classes instantiated via DI - CA1031: Intentional catch-all in TryLoad/IsValid methods - CA1303: CLI is not localized - CA1308: ToLowerInvariant intentional for identifiers - Other code style warnings that don't apply to CLI tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds comprehensive handler tests for the Identity module's auth-critical handlers.
New Test Files (1,470 lines)
GenerateTokenCommandHandlerTests.cs- login flowRefreshTokenCommandHandlerTests.cs- token refreshRegisterUserCommandHandlerTests.cs- user registrationRevokeSessionCommandHandlerTests.cs- session managementChangePasswordCommandHandlerTests.cs- password changeCoverage Per Handler
Testing Stack
Uses existing patterns: xUnit, Shouldly, NSubstitute, AutoFixture
Addresses #1173 (partial - 5 of 60+ handlers now tested)