Add unit tests for shared user covering shared and separate database#25319
Merged
Add unit tests for shared user covering shared and separate database#25319
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds reusable unit test suites to validate IdentityUserManager.FindSharedUserBy*Async behavior for shared-user mode across both shared database and separate database multi-tenancy topologies, with concrete EF Core and MongoDB runners.
Changes:
- Introduces abstract shared-user test suites in
Volo.Abp.Identity.TestBasefor shared DB and separate DB topologies. - Adds concrete EF Core and MongoDB test classes/modules to execute the suites on each backend/topology.
- Removes the older inlined shared-user test class from
IdentityUserManager_Tests.csin favor of the new shared suites.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityUserManager_SharedUser_Tests.cs | New abstract suite covering shared-user resolution (email/name/login/passkey/id) in shared-db mode. |
| modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityUserManager_SharedUser_SeparateDatabase_Tests.cs | New abstract suite verifying separate-database isolation semantics under shared-user mode. |
| modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/IdentityUserManager_SharedUser_Tests.cs | MongoDB concrete runner for shared-db shared-user suite. |
| modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/IdentityUserManager_SharedUser_SeparateDatabase_Tests.cs | MongoDB concrete runner for separate-db isolation suite. |
| modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentitySharedUserSeparateDbMongoDbTestModule.cs | MongoDB test module configuring two predefined tenants with separate physical databases. |
| modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentitySharedUserSeparateDbEntityFrameworkCoreTestModule.cs | EF Core test module configuring host + two tenants with separate in-memory SQLite databases. |
| modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityUserManager_Tests.cs | Removes the previous dedicated shared-user test class now covered by the new suites. |
| modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityUserManager_SharedUser_Tests.cs | EF-based concrete runner for shared-db shared-user suite. |
| modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityUserManager_SharedUser_SeparateDatabase_Tests.cs | EF-based concrete runner for separate-db isolation suite. |
ismcagdas
approved these changes
Apr 27, 2026
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.
Adds abstract test suites in TestBase and concrete EF/Mongo subclasses for shared user (
IdentityUserManager.FindSharedUserBy*Async) under both shared-database and separate-database multi-tenancy topologies.