From 27165d924d36e2f0626352b0fbcacc2630b285b9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Oct 2025 01:26:46 +0000 Subject: [PATCH 1/6] Initial plan From 7003087cf6e4a4193df0ca59845bfe864f9d5e6b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Oct 2025 01:40:21 +0000 Subject: [PATCH 2/6] Update xUnit to v3 and fix ValueTask return types Co-authored-by: JohnCampionJr <1094820+JohnCampionJr@users.noreply.github.com> --- .../MongoEntityFramework.AspNetCore.Identity.Tests.csproj | 2 +- .../MongoIdentityContextsTests.cs | 4 ++-- .../MongoRoleStoreTests.cs | 4 ++-- .../MongoUserOnlyStoreTests/AddClaims.cs | 4 ++-- .../MongoUserOnlyStoreTests/AddLogin.cs | 4 ++-- .../MongoUserOnlyStoreTests/FindByEmail.cs | 4 ++-- .../MongoUserOnlyStoreTests/FindById.cs | 4 ++-- .../MongoUserOnlyStoreTests/FindByLogin.cs | 4 ++-- .../MongoUserOnlyStoreTests/FindByName.cs | 4 ++-- .../MongoUserOnlyStoreTests/GetClaims.cs | 4 ++-- .../MongoUserOnlyStoreTests/GetLogins.cs | 4 ++-- .../MongoUserOnlyStoreTests/GetToken.cs | 4 ++-- .../MongoUserOnlyStoreTests/GetUsersForClaim.cs | 4 ++-- .../MongoUserOnlyStoreTests/RemoveClaim.cs | 4 ++-- .../MongoUserOnlyStoreTests/RemoveLogin.cs | 4 ++-- .../MongoUserOnlyStoreTests/RemoveToken.cs | 4 ++-- .../MongoUserOnlyStoreTests/ReplaceClaim.cs | 4 ++-- .../MongoUserOnlyStoreTests/SetToken.cs | 4 ++-- .../MongoUserOnlyStoreTests/UpdateUser.cs | 4 ++-- .../MongoUserStoreTests/FindByEmail.cs | 4 ++-- .../MongoUserStoreTests/FindByLogin.cs | 4 ++-- .../MongoUserStoreTests/FindByName.cs | 4 ++-- .../MongoUserStoreTests/FindUserRole.cs | 4 ++-- .../MongoUserStoreTests/GetRoles.cs | 4 ++-- 24 files changed, 47 insertions(+), 47 deletions(-) diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoEntityFramework.AspNetCore.Identity.Tests.csproj b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoEntityFramework.AspNetCore.Identity.Tests.csproj index 4975a62..062c366 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoEntityFramework.AspNetCore.Identity.Tests.csproj +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoEntityFramework.AspNetCore.Identity.Tests.csproj @@ -19,7 +19,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoIdentityContextsTests.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoIdentityContextsTests.cs index 12f8241..b17d837 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoIdentityContextsTests.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoIdentityContextsTests.cs @@ -22,7 +22,7 @@ public class MongoIdentityContextsTests : TestBase, IAsyncLifetime public MongoIdentityContextsTests() : base("MongoIdentityContexts") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoIdentityDbContext(GetConnection()); var store = new MongoUserStore(context); @@ -40,7 +40,7 @@ public async Task InitializeAsync() } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public void ContextWithRolesLoadsRoles() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoRoleStoreTests.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoRoleStoreTests.cs index 8f408c0..e4c2b9a 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoRoleStoreTests.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoRoleStoreTests.cs @@ -12,7 +12,7 @@ public class MongoRoleStoreTests : TestBase, IAsyncLifetime public MongoRoleStoreTests() : base("MongoRoleStore") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); @@ -30,7 +30,7 @@ public async Task InitializeAsync() } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public void ConstructorUsesMongo() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddClaims.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddClaims.cs index b80393e..7cc9e59 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddClaims.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddClaims.cs @@ -14,7 +14,7 @@ public class AddClaims : TestBase, IAsyncLifetime public AddClaims() : base("MongoUserOnlyStore-AddClaims") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -22,7 +22,7 @@ public async Task InitializeAsync() await store.CreateAsync(MongoTestUser.First); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task UpdatesUser() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddLogin.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddLogin.cs index 478b784..7037ef5 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddLogin.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddLogin.cs @@ -14,7 +14,7 @@ public class AddLogin : TestBase, IAsyncLifetime public AddLogin() : base("MongoUserOnlyStore-AddLogin") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -24,7 +24,7 @@ public async Task InitializeAsync() await store.CreateAsync(MongoTestUser.Third); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task UpdatesUser() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByEmail.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByEmail.cs index be42d00..c4d7271 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByEmail.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByEmail.cs @@ -13,7 +13,7 @@ public class FindByEmail : TestBase, IAsyncLifetime public FindByEmail() : base("MongoUserOnlyStore-FindByEmail") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -23,7 +23,7 @@ public async Task InitializeAsync() await store.CreateAsync(MongoTestUser.Third); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task FindsCorrectUserWithValidEmail() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindById.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindById.cs index b1329df..126f366 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindById.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindById.cs @@ -14,7 +14,7 @@ public class FindById : TestBase, IAsyncLifetime public FindById() : base("MongoUserOnlyStore-FindById") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -28,7 +28,7 @@ public async Task InitializeAsync() await store2.CreateAsync(MongoTestUserInt.Third); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task FindsCorrectUserWithValidStringId() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByLogin.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByLogin.cs index 8c01b7f..cf2441c 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByLogin.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByLogin.cs @@ -25,7 +25,7 @@ public async Task> ExposeFindUserLoginAsync(string use public FindByLogin() : base("MongoUserOnlyStore-FindByLogin") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -44,7 +44,7 @@ public async Task InitializeAsync() } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task GetsCorrectUserFromLogin() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByName.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByName.cs index ba0285f..b088caa 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByName.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByName.cs @@ -13,7 +13,7 @@ public class FindByName : TestBase, IAsyncLifetime public FindByName() : base("MongoUserOnlyStore-FindByName") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -23,7 +23,7 @@ public async Task InitializeAsync() await store.CreateAsync(MongoTestUser.Third); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task FindsCorrectUserWithValidUserName() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetClaims.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetClaims.cs index 8b06401..1f989f0 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetClaims.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetClaims.cs @@ -14,7 +14,7 @@ public class GetClaims : TestBase, IAsyncLifetime public GetClaims() : base("MongoUserOnlyStore-GetClaims") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -31,7 +31,7 @@ await store.AddClaimsAsync(user, } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task RetrievesClaimsFromUser() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetLogins.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetLogins.cs index 35ecc91..f4e3e4c 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetLogins.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetLogins.cs @@ -14,7 +14,7 @@ public class GetLogins : TestBase, IAsyncLifetime public GetLogins() : base("MongoUserOnlyStore-GetLogins") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -27,7 +27,7 @@ public async Task InitializeAsync() } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task RetrieveLoginsFromUser() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetToken.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetToken.cs index da2fb57..dde67c6 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetToken.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetToken.cs @@ -14,7 +14,7 @@ public class GetToken : TestBase, IAsyncLifetime public GetToken() : base("MongoUserOnlyStore-GetToken") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); @@ -27,7 +27,7 @@ public async Task InitializeAsync() await store.UpdateAsync(user); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task RetrieveLoginsFromUser() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetUsersForClaim.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetUsersForClaim.cs index 583af28..8350d73 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetUsersForClaim.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetUsersForClaim.cs @@ -14,7 +14,7 @@ public class GetUsersForClaim : TestBase, IAsyncLifetime public GetUsersForClaim() : base("MongoUserOnlyStore-GetUsersForClaim") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -49,7 +49,7 @@ await store.AddClaimsAsync(user, } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task RetrieveUsersForClaim() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveClaim.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveClaim.cs index a144a8a..af291bb 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveClaim.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveClaim.cs @@ -14,7 +14,7 @@ public class RemoveClaim : TestBase, IAsyncLifetime public RemoveClaim() : base("MongoUserOnlyStore-RemoveClaim") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -31,7 +31,7 @@ await store.AddClaimsAsync(user, } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task RemoveClaimWithExistingClaim() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveLogin.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveLogin.cs index ad4605d..ade03a0 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveLogin.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveLogin.cs @@ -14,7 +14,7 @@ public class RemoveLogin : TestBase, IAsyncLifetime public RemoveLogin() : base("MongoUserOnlyStore-RemoveLogin") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -26,7 +26,7 @@ public async Task InitializeAsync() } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task RemoveLoginWithExistingLogin() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveToken.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveToken.cs index de0bec0..d39d830 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveToken.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveToken.cs @@ -14,7 +14,7 @@ public class RemoveToken : TestBase, IAsyncLifetime public RemoveToken() : base("MongoUserOnlyStore-RemoveToken") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); @@ -27,7 +27,7 @@ public async Task InitializeAsync() await store.UpdateAsync(user); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task RemovesToken() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/ReplaceClaim.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/ReplaceClaim.cs index 22d2e09..953040b 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/ReplaceClaim.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/ReplaceClaim.cs @@ -14,7 +14,7 @@ public class ReplaceClaim : TestBase, IAsyncLifetime public ReplaceClaim() : base("MongoUserOnlyStore-ReplaceClaim") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -31,7 +31,7 @@ await store.AddClaimsAsync(user, } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task ReplaceUsersClaim() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/SetToken.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/SetToken.cs index 508a537..09d7130 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/SetToken.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/SetToken.cs @@ -14,7 +14,7 @@ public class SetToken : TestBase, IAsyncLifetime public SetToken() : base("MongoUserOnlyStore-SetToken") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -22,7 +22,7 @@ public async Task InitializeAsync() await store.CreateAsync(MongoTestUser.First); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task UpdatesUserWithValidData() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/UpdateUser.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/UpdateUser.cs index ea7eae4..55f11ec 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/UpdateUser.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/UpdateUser.cs @@ -13,7 +13,7 @@ public class UpdateUser : TestBase, IAsyncLifetime public UpdateUser() : base("MongoUserOnlyStore-UpdateUser") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); @@ -23,7 +23,7 @@ public async Task InitializeAsync() await store.CreateAsync(MongoTestUser.Third); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task ReturnsSuccess() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByEmail.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByEmail.cs index e5d0c01..54d99ad 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByEmail.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByEmail.cs @@ -13,7 +13,7 @@ public class FindByEmail : TestBase, IAsyncLifetime public FindByEmail() : base("MongoUserStore-FindByEmail") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); @@ -23,7 +23,7 @@ public async Task InitializeAsync() await store.CreateAsync(MongoTestUser.Third); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task FindsCorrectUserWithValidEmail() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByLogin.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByLogin.cs index 4c9a9b6..3db9f57 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByLogin.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByLogin.cs @@ -25,7 +25,7 @@ public async Task> ExposeFindUserLoginAsync(string use public FindByLogin() : base("MongoUserStore-FindByLogin") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); @@ -44,7 +44,7 @@ public async Task InitializeAsync() } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task GetsCorrectUserFromLogin() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByName.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByName.cs index d7747c2..c1ca4ea 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByName.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByName.cs @@ -13,7 +13,7 @@ public class FindByName : TestBase, IAsyncLifetime public FindByName() : base("MongoUserStore-FindByName") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); @@ -23,7 +23,7 @@ public async Task InitializeAsync() await store.CreateAsync(MongoTestUser.Third); } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task FindsCorrectUserWithValidUserName() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindUserRole.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindUserRole.cs index d975ac3..c53a6e5 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindUserRole.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindUserRole.cs @@ -25,7 +25,7 @@ public async Task> ExposeFindUserRoleAsync(string userI public FindUserRole() : base("MongoUserStore-FindUserRole") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); @@ -43,7 +43,7 @@ public async Task InitializeAsync() } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task FindUserRoleWithValidRole() diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/GetRoles.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/GetRoles.cs index 1d83c67..972ec68 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/GetRoles.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/GetRoles.cs @@ -14,7 +14,7 @@ public class GetRoles : TestBase, IAsyncLifetime public GetRoles() : base("MongoUserStore-GetRoles") { } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); @@ -32,7 +32,7 @@ public async Task InitializeAsync() } - public Task DisposeAsync() => Task.CompletedTask; + public ValueTask DisposeAsync() => ValueTask.CompletedTask; [Fact] public async Task GetRolesWithUser() From 035cd03af71e149cd5bf5cd99a401baf6e4c2214 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Oct 2025 01:47:38 +0000 Subject: [PATCH 3/6] Fix all cancellation token warnings for xUnit v3 Co-authored-by: JohnCampionJr <1094820+JohnCampionJr@users.noreply.github.com> --- .../MongoRoleStoreTests.cs | 2 +- .../MongoUserOnlyStoreTests/AddClaims.cs | 12 ++--- .../MongoUserOnlyStoreTests/AddLogin.cs | 12 ++--- .../MongoUserOnlyStoreTests/CreateUser.cs | 10 ++--- .../MongoUserOnlyStoreTests/DeleteUser.cs | 12 ++--- .../MongoUserOnlyStoreTests/FindByEmail.cs | 8 ++-- .../MongoUserOnlyStoreTests/FindById.cs | 8 ++-- .../MongoUserOnlyStoreTests/FindByLogin.cs | 6 +-- .../MongoUserOnlyStoreTests/FindByName.cs | 8 ++-- .../MongoUserOnlyStoreTests/GetClaims.cs | 4 +- .../MongoUserOnlyStoreTests/GetLogins.cs | 4 +- .../MongoUserOnlyStoreTests/GetToken.cs | 6 +-- .../GetUsersForClaim.cs | 4 +- .../MongoUserOnlyStoreTests/RemoveClaim.cs | 20 ++++----- .../MongoUserOnlyStoreTests/RemoveLogin.cs | 12 ++--- .../MongoUserOnlyStoreTests/RemoveToken.cs | 12 ++--- .../MongoUserOnlyStoreTests/ReplaceClaim.cs | 16 +++---- .../MongoUserOnlyStoreTests/SetToken.cs | 12 ++--- .../MongoUserOnlyStoreTests/UpdateUser.cs | 8 ++-- .../MongoUserStoreTests/FindByEmail.cs | 8 ++-- .../MongoUserStoreTests/FindByLogin.cs | 6 +-- .../MongoUserStoreTests/FindByName.cs | 8 ++-- .../MongoUserStoreTests/GetRoles.cs | 4 +- .../MongoUserStoreTests/IdentitySpecTests.cs | 44 +++++++++---------- 24 files changed, 123 insertions(+), 123 deletions(-) diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoRoleStoreTests.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoRoleStoreTests.cs index e4c2b9a..38159f6 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoRoleStoreTests.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoRoleStoreTests.cs @@ -71,7 +71,7 @@ public async Task GetNormalizedRoleReturnsCorrect() var store = new MongoRoleStore, DbContext, int>(context); var role = new MongoIdentityRole { Name = "testrole", NormalizedName = "TESTROLE" }; - var name = await store.GetNormalizedRoleNameAsync(role); + var name = await store.GetNormalizedRoleNameAsync(role, TestContext.Current.CancellationToken); name.Should().Be("TESTROLE"); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddClaims.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddClaims.cs index 7cc9e59..b299b5d 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddClaims.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddClaims.cs @@ -29,14 +29,14 @@ public async Task UpdatesUser() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); await store.AddClaimsAsync(user, new[] { new Claim("type","value"), new Claim("type2", "value2") - }); + }, TestContext.Current.CancellationToken); user.Claims.Count.Should().Be(2); user.Claims[0].ClaimType.Should().Be("type"); @@ -47,20 +47,20 @@ public async Task SavesData() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); await store.AddClaimsAsync(user, new[] { new Claim("type","value"), new Claim("type2", "value2") - }); + }, TestContext.Current.CancellationToken); - await store.UpdateAsync(user); + await store.UpdateAsync(user, TestContext.Current.CancellationToken); context = new MongoTestContext(GetConnection()); store = new MongoUserOnlyStore(context); - user = await store.FindByIdAsync(TestIds.UserId1); + user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); user.Claims.Count.Should().Be(2); user.Claims[0].ClaimType.Should().Be("type"); diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddLogin.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddLogin.cs index 7037ef5..f9ad1cd 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddLogin.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/AddLogin.cs @@ -31,9 +31,9 @@ public async Task UpdatesUser() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - await store.AddLoginAsync(user, new UserLoginInfo("provider1", "provider-key", "Login Provider")); + await store.AddLoginAsync(user, new UserLoginInfo("provider1", "provider-key", "Login Provider"), TestContext.Current.CancellationToken); user.Logins.Count.Should().Be(1); user.Logins[0].LoginProvider.Should().Be("provider1"); @@ -44,14 +44,14 @@ public async Task SavesData() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - await store.AddLoginAsync(user, new UserLoginInfo("provider1", "provider-key", "Login Provider")); - await store.UpdateAsync(user); + await store.AddLoginAsync(user, new UserLoginInfo("provider1", "provider-key", "Login Provider"), TestContext.Current.CancellationToken); + await store.UpdateAsync(user, TestContext.Current.CancellationToken); context = new MongoTestContext(GetConnection()); store = new MongoUserOnlyStore(context); - user = await store.FindByIdAsync(TestIds.UserId1); + user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); user.Logins.Count.Should().Be(1); user.Logins[0].LoginProvider.Should().Be("provider1"); diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/CreateUser.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/CreateUser.cs index 11e8989..6efd6fb 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/CreateUser.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/CreateUser.cs @@ -20,7 +20,7 @@ public async Task ReturnsSuccessWithStringId() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var result = await store.CreateAsync(MongoTestUser.First); + var result = await store.CreateAsync(MongoTestUser.First, TestContext.Current.CancellationToken); result.Should().Be(IdentityResult.Success); } @@ -31,7 +31,7 @@ public async Task CreatesDataWithStringId() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - await store.CreateAsync(MongoTestUser.First); + await store.CreateAsync(MongoTestUser.First, TestContext.Current.CancellationToken); context.TestUsers.Any().Should().BeTrue(); context.TestUsers.Count().Should().Be(1); @@ -46,7 +46,7 @@ public async Task DoesNotCreatesDataWithAutoSaveOff() store.AutoSaveChanges = false; - await store.CreateAsync(MongoTestUser.First); + await store.CreateAsync(MongoTestUser.First, TestContext.Current.CancellationToken); context.TestUsers.Any().Should().BeFalse(); context.TestUsers.Count().Should().Be(0); @@ -59,7 +59,7 @@ public async Task ReturnsSuccessWithIntId() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var result = await store.CreateAsync(MongoTestUserInt.First); + var result = await store.CreateAsync(MongoTestUserInt.First, TestContext.Current.CancellationToken); result.Should().Be(IdentityResult.Success); } @@ -70,7 +70,7 @@ public async Task CreatesDataWithIntId() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - await store.CreateAsync(MongoTestUserInt.First); + await store.CreateAsync(MongoTestUserInt.First, TestContext.Current.CancellationToken); context.TestUsersInt.Any().Should().BeTrue(); context.TestUsersInt.Count().Should().Be(1); diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/DeleteUser.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/DeleteUser.cs index 842087d..5d99697 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/DeleteUser.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/DeleteUser.cs @@ -19,15 +19,15 @@ public async Task DeletesDataWithValidUser() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - await store.CreateAsync(MongoTestUser.First); + await store.CreateAsync(MongoTestUser.First, TestContext.Current.CancellationToken); context.TestUsers.Any().Should().BeTrue(); context = new MongoTestContext(GetConnection()); store = new MongoUserOnlyStore(context); - var user = await context.TestUsers.FirstOrDefaultAsync(); + var user = await context.TestUsers.FirstOrDefaultAsync(TestContext.Current.CancellationToken); - await store.DeleteAsync(user); + await store.DeleteAsync(user, TestContext.Current.CancellationToken); context.TestUsers.Any().Should().BeFalse(); } @@ -37,15 +37,15 @@ public async Task ReturnsSuccessWithValidUser() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - await store.CreateAsync(MongoTestUser.First); + await store.CreateAsync(MongoTestUser.First, TestContext.Current.CancellationToken); context.TestUsers.Any().Should().BeTrue(); context = new MongoTestContext(GetConnection()); store = new MongoUserOnlyStore(context); - var user = await context.TestUsers.FirstOrDefaultAsync(); + var user = await context.TestUsers.FirstOrDefaultAsync(TestContext.Current.CancellationToken); - var result = await store.DeleteAsync(user); + var result = await store.DeleteAsync(user, TestContext.Current.CancellationToken); result.Should().Be(IdentityResult.Success); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByEmail.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByEmail.cs index c4d7271..a0c77f2 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByEmail.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByEmail.cs @@ -31,7 +31,7 @@ public async Task FindsCorrectUserWithValidEmail() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var result = await store.FindByEmailAsync("TEST3@TESTING.COM"); + var result = await store.FindByEmailAsync("TEST3@TESTING.COM", TestContext.Current.CancellationToken); result.Should().NotBeNull(); result.UserName.Should().Be("User Name3"); @@ -42,10 +42,10 @@ public async Task FindsTrackedEntityWithValidEmail() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var tracked = await store.FindByIdAsync(TestIds.UserId2); + var tracked = await store.FindByIdAsync(TestIds.UserId2, TestContext.Current.CancellationToken); tracked.CustomData = "updated"; - var result = await store.FindByEmailAsync("TEST2@TESTING.COM"); + var result = await store.FindByEmailAsync("TEST2@TESTING.COM", TestContext.Current.CancellationToken); result.Should().BeSameAs(tracked); result.CustomData.Should().Be("updated"); @@ -57,7 +57,7 @@ public async Task ReturnsNullWithInvalidEmail() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var result = await store.FindByEmailAsync("none"); + var result = await store.FindByEmailAsync("none", TestContext.Current.CancellationToken); result.Should().BeNull(); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindById.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindById.cs index 126f366..df52d17 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindById.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindById.cs @@ -36,7 +36,7 @@ public async Task FindsCorrectUserWithValidStringId() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var result = await store.FindByIdAsync(TestIds.UserId2); + var result = await store.FindByIdAsync(TestIds.UserId2, TestContext.Current.CancellationToken); result.Should().NotBeNull(); result.UserName.Should().Be("User Name2"); @@ -48,7 +48,7 @@ public async Task ReturnsNullWithInvalidStringId() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var result = await store.FindByIdAsync("none"); + var result = await store.FindByIdAsync("none", TestContext.Current.CancellationToken); result.Should().BeNull(); } @@ -59,7 +59,7 @@ public async Task FindsCorrectUserWithValidIntId() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var result = await store.FindByIdAsync("2000"); + var result = await store.FindByIdAsync("2000", TestContext.Current.CancellationToken); result.Should().NotBeNull(); result.UserName.Should().Be("User Name2"); @@ -71,7 +71,7 @@ public async Task ReturnsNullWithInvalidIntId() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var result = await store.FindByIdAsync("1234"); + var result = await store.FindByIdAsync("1234", TestContext.Current.CancellationToken); result.Should().BeNull(); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByLogin.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByLogin.cs index cf2441c..605ebd9 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByLogin.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByLogin.cs @@ -52,7 +52,7 @@ public async Task GetsCorrectUserFromLogin() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByLoginAsync("provider3", "provider-key"); + var user = await store.FindByLoginAsync("provider3", "provider-key", TestContext.Current.CancellationToken); user.Should().NotBeNull(); user.Id.Should().Be(TestIds.UserId2); @@ -77,7 +77,7 @@ public async Task ReturnsNullFromNonExisting() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByLoginAsync("provider5", "provider-key"); + var user = await store.FindByLoginAsync("provider5", "provider-key", TestContext.Current.CancellationToken); user.Should().BeNull(); } @@ -88,7 +88,7 @@ public async Task ReturnsNullFromNull() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByLoginAsync(null, "provider-key"); + var user = await store.FindByLoginAsync(null, "provider-key", TestContext.Current.CancellationToken); user.Should().BeNull(); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByName.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByName.cs index b088caa..fb60826 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByName.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/FindByName.cs @@ -31,7 +31,7 @@ public async Task FindsCorrectUserWithValidUserName() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var result = await store.FindByNameAsync("USER NAME2"); + var result = await store.FindByNameAsync("USER NAME2", TestContext.Current.CancellationToken); result.Should().NotBeNull(); result.UserName.Should().Be("User Name2"); @@ -43,10 +43,10 @@ public async Task FindsTrackedEntityWithValidUserName() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var tracked = await store.FindByIdAsync(TestIds.UserId2); + var tracked = await store.FindByIdAsync(TestIds.UserId2, TestContext.Current.CancellationToken); tracked.CustomData = "updated"; - var result = await store.FindByNameAsync("USER NAME2"); + var result = await store.FindByNameAsync("USER NAME2", TestContext.Current.CancellationToken); result.Should().BeSameAs(tracked); result.CustomData.Should().Be("updated"); @@ -59,7 +59,7 @@ public async Task ReturnsNullWithInvalidUserName() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var result = await store.FindByNameAsync("none"); + var result = await store.FindByNameAsync("none", TestContext.Current.CancellationToken); result.Should().BeNull(); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetClaims.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetClaims.cs index 1f989f0..6a958d8 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetClaims.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetClaims.cs @@ -38,9 +38,9 @@ public async Task RetrievesClaimsFromUser() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - var claims = await store.GetClaimsAsync(user); + var claims = await store.GetClaimsAsync(user, TestContext.Current.CancellationToken); claims.Count.Should().Be(2); claims[0].Type.Should().Be("type"); diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetLogins.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetLogins.cs index f4e3e4c..50d5ab7 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetLogins.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetLogins.cs @@ -34,9 +34,9 @@ public async Task RetrieveLoginsFromUser() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - var logins = await store.GetLoginsAsync(user); + var logins = await store.GetLoginsAsync(user, TestContext.Current.CancellationToken); logins.Count.Should().Be(2); logins[0].LoginProvider.Should().Be("provider1"); diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetToken.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetToken.cs index dde67c6..dc4169c 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetToken.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetToken.cs @@ -34,10 +34,10 @@ public async Task RetrieveLoginsFromUser() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - var token1 = await store.GetTokenAsync(user, "provider1", "name1", default); - var token2 = await store.GetTokenAsync(user, "provider2", "name2", default); + var token1 = await store.GetTokenAsync(user, "provider1", "name1", TestContext.Current.CancellationToken); + var token2 = await store.GetTokenAsync(user, "provider2", "name2", TestContext.Current.CancellationToken); token1.Should().Be("token-value1"); token2.Should().Be("token-value2"); diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetUsersForClaim.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetUsersForClaim.cs index 8350d73..b094431 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetUsersForClaim.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/GetUsersForClaim.cs @@ -57,8 +57,8 @@ public async Task RetrieveUsersForClaim() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var users = await store.GetUsersForClaimAsync(new Claim("type", "value")); - var users2 = await store.GetUsersForClaimAsync(new Claim("type2", "value2")); + var users = await store.GetUsersForClaimAsync(new Claim("type", "value"), TestContext.Current.CancellationToken); + var users2 = await store.GetUsersForClaimAsync(new Claim("type2", "value2"), TestContext.Current.CancellationToken); users.Count.Should().Be(3); users2.Count.Should().Be(2); diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveClaim.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveClaim.cs index af291bb..92b12be 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveClaim.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveClaim.cs @@ -38,11 +38,11 @@ public async Task RemoveClaimWithExistingClaim() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - var claims = await store.GetClaimsAsync(user); + var claims = await store.GetClaimsAsync(user, TestContext.Current.CancellationToken); - await store.RemoveClaimsAsync(user, claims); + await store.RemoveClaimsAsync(user, claims, TestContext.Current.CancellationToken); user.Claims.Count.Should().Be(0); } @@ -52,12 +52,12 @@ public async Task RemoveClaimWithNewClaim() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); await store.RemoveClaimsAsync(user, new[] { new Claim("type","value"), new Claim("type2", "value2") - }); + }, TestContext.Current.CancellationToken); user.Claims.Count.Should().Be(0); } @@ -67,16 +67,16 @@ public async Task SavesData() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - var claims = await store.GetClaimsAsync(user); + var claims = await store.GetClaimsAsync(user, TestContext.Current.CancellationToken); - await store.RemoveClaimsAsync(user, claims); - await store.UpdateAsync(user); + await store.RemoveClaimsAsync(user, claims, TestContext.Current.CancellationToken); + await store.UpdateAsync(user, TestContext.Current.CancellationToken); context = new MongoTestContext(GetConnection()); store = new MongoUserOnlyStore(context); - user = await store.FindByIdAsync(TestIds.UserId1); + user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); user.Claims.Count.Should().Be(0); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveLogin.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveLogin.cs index ade03a0..b5c0ab9 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveLogin.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveLogin.cs @@ -33,9 +33,9 @@ public async Task RemoveLoginWithExistingLogin() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - await store.RemoveLoginAsync(user, "provider1", "provider-key"); + await store.RemoveLoginAsync(user, "provider1", "provider-key", TestContext.Current.CancellationToken); user.Logins.Count.Should().Be(0); } @@ -45,14 +45,14 @@ public async Task SavesData() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - await store.RemoveLoginAsync(user, "provider1", "provider-key"); - await store.UpdateAsync(user); + await store.RemoveLoginAsync(user, "provider1", "provider-key", TestContext.Current.CancellationToken); + await store.UpdateAsync(user, TestContext.Current.CancellationToken); context = new MongoTestContext(GetConnection()); store = new MongoUserOnlyStore(context); - user = await store.FindByIdAsync(TestIds.UserId1); + user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); user.Logins.Count.Should().Be(0); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveToken.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveToken.cs index d39d830..51e3c02 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveToken.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/RemoveToken.cs @@ -34,9 +34,9 @@ public async Task RemovesToken() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - await store.RemoveTokenAsync(user, "provider2", "name2", default); + await store.RemoveTokenAsync(user, "provider2", "name2", TestContext.Current.CancellationToken); user.Tokens.Count.Should().Be(1); } @@ -46,16 +46,16 @@ public async Task SavesData() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - await store.RemoveTokenAsync(user, "provider2", "name2", default); + await store.RemoveTokenAsync(user, "provider2", "name2", TestContext.Current.CancellationToken); - await store.UpdateAsync(user); + await store.UpdateAsync(user, TestContext.Current.CancellationToken); context = new MongoTestContext(GetConnection()); store = new MongoUserOnlyStore(context); - user = await store.FindByIdAsync(TestIds.UserId1); + user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); user.Tokens.Count.Should().Be(1); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/ReplaceClaim.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/ReplaceClaim.cs index 953040b..32172f0 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/ReplaceClaim.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/ReplaceClaim.cs @@ -38,12 +38,12 @@ public async Task ReplaceUsersClaim() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - var claims = await store.GetClaimsAsync(user); + var claims = await store.GetClaimsAsync(user, TestContext.Current.CancellationToken); var claim = claims[0]; - await store.ReplaceClaimAsync(user, claim, new Claim("new-type", "new-value")); + await store.ReplaceClaimAsync(user, claim, new Claim("new-type", "new-value"), TestContext.Current.CancellationToken); user.Claims[0].ClaimType.Should().Be("new-type"); user.Claims[0].ClaimValue.Should().Be("new-value"); @@ -54,18 +54,18 @@ public async Task SavesData() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - var claims = await store.GetClaimsAsync(user); + var claims = await store.GetClaimsAsync(user, TestContext.Current.CancellationToken); var claim = claims[0]; - await store.ReplaceClaimAsync(user, claim, new Claim("new-type", "new-value")); + await store.ReplaceClaimAsync(user, claim, new Claim("new-type", "new-value"), TestContext.Current.CancellationToken); - await store.UpdateAsync(user); + await store.UpdateAsync(user, TestContext.Current.CancellationToken); context = new MongoTestContext(GetConnection()); store = new MongoUserOnlyStore(context); - user = await store.FindByIdAsync(TestIds.UserId1); + user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); user.Claims.Count.Should().Be(2); user.Claims[0].ClaimType.Should().Be("new-type"); diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/SetToken.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/SetToken.cs index 09d7130..07d5986 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/SetToken.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/SetToken.cs @@ -29,9 +29,9 @@ public async Task UpdatesUserWithValidData() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - await store.SetTokenAsync(user, "provider", "name", "token-value", default); + await store.SetTokenAsync(user, "provider", "name", "token-value", TestContext.Current.CancellationToken); user.Tokens.Count.Should().Be(1); user.Tokens[0].Value.Should().Be("token-value"); @@ -42,15 +42,15 @@ public async Task SavesData() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - await store.SetTokenAsync(user, "provider", "name", "token-value", default); + await store.SetTokenAsync(user, "provider", "name", "token-value", TestContext.Current.CancellationToken); - await store.UpdateAsync(user); + await store.UpdateAsync(user, TestContext.Current.CancellationToken); context = new MongoTestContext(GetConnection()); store = new MongoUserOnlyStore(context); - user = await store.FindByIdAsync(TestIds.UserId1); + user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); user.Tokens.Count.Should().Be(1); user.Tokens[0].Value.Should().Be("token-value"); diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/UpdateUser.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/UpdateUser.cs index 55f11ec..6905629 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/UpdateUser.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserOnlyStoreTests/UpdateUser.cs @@ -30,10 +30,10 @@ public async Task ReturnsSuccess() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); user.CustomData = "new-data"; - var result = await store.UpdateAsync(user); + var result = await store.UpdateAsync(user, TestContext.Current.CancellationToken); result.Should().Be(IdentityResult.Success); } @@ -44,10 +44,10 @@ public async Task SavesData() var context = new MongoTestContext(GetConnection()); var store = new MongoUserOnlyStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); user.CustomData = "new-data"; - await store.UpdateAsync(user); + await store.UpdateAsync(user, TestContext.Current.CancellationToken); context.TestUsers.FirstOrDefault()?.CustomData.Should().Be("new-data"); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByEmail.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByEmail.cs index 54d99ad..ab88d30 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByEmail.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByEmail.cs @@ -31,7 +31,7 @@ public async Task FindsCorrectUserWithValidEmail() var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); - var result = await store.FindByEmailAsync("TEST3@TESTING.COM"); + var result = await store.FindByEmailAsync("TEST3@TESTING.COM", TestContext.Current.CancellationToken); result.Should().NotBeNull(); result.UserName.Should().Be("User Name3"); @@ -42,10 +42,10 @@ public async Task FindsTrackedEntityWithValidEmail() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); - var tracked = await store.FindByIdAsync(TestIds.UserId2); + var tracked = await store.FindByIdAsync(TestIds.UserId2, TestContext.Current.CancellationToken); tracked.CustomData = "updated"; - var result = await store.FindByEmailAsync("TEST2@TESTING.COM"); + var result = await store.FindByEmailAsync("TEST2@TESTING.COM", TestContext.Current.CancellationToken); result.Should().BeSameAs(tracked); result.CustomData.Should().Be("updated"); @@ -57,7 +57,7 @@ public async Task ReturnsNullWithInvalidEmail() var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); - var result = await store.FindByEmailAsync("none"); + var result = await store.FindByEmailAsync("none", TestContext.Current.CancellationToken); result.Should().BeNull(); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByLogin.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByLogin.cs index 3db9f57..dcac963 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByLogin.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByLogin.cs @@ -52,7 +52,7 @@ public async Task GetsCorrectUserFromLogin() var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); - var user = await store.FindByLoginAsync("provider3", "provider-key"); + var user = await store.FindByLoginAsync("provider3", "provider-key", TestContext.Current.CancellationToken); user.Should().NotBeNull(); user.Id.Should().Be(TestIds.UserId2); @@ -77,7 +77,7 @@ public async Task ReturnsNullFromNonExisting() var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); - var user = await store.FindByLoginAsync("provider5", "provider-key"); + var user = await store.FindByLoginAsync("provider5", "provider-key", TestContext.Current.CancellationToken); user.Should().BeNull(); } @@ -88,7 +88,7 @@ public async Task ReturnsNullFromNull() var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); - var user = await store.FindByLoginAsync(null, "provider-key"); + var user = await store.FindByLoginAsync(null, "provider-key", TestContext.Current.CancellationToken); user.Should().BeNull(); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByName.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByName.cs index c1ca4ea..d7138f6 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByName.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/FindByName.cs @@ -31,7 +31,7 @@ public async Task FindsCorrectUserWithValidUserName() var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); - var result = await store.FindByNameAsync("USER NAME2"); + var result = await store.FindByNameAsync("USER NAME2", TestContext.Current.CancellationToken); result.Should().NotBeNull(); result.UserName.Should().Be("User Name2"); @@ -43,10 +43,10 @@ public async Task FindsTrackedEntityWithValidUserName() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); - var tracked = await store.FindByIdAsync(TestIds.UserId2); + var tracked = await store.FindByIdAsync(TestIds.UserId2, TestContext.Current.CancellationToken); tracked.CustomData = "updated"; - var result = await store.FindByNameAsync("USER NAME2"); + var result = await store.FindByNameAsync("USER NAME2", TestContext.Current.CancellationToken); result.Should().BeSameAs(tracked); result.CustomData.Should().Be("updated"); @@ -59,7 +59,7 @@ public async Task ReturnsNullWithInvalidUserName() var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); - var result = await store.FindByNameAsync("none"); + var result = await store.FindByNameAsync("none", TestContext.Current.CancellationToken); result.Should().BeNull(); } diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/GetRoles.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/GetRoles.cs index 972ec68..b51c005 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/GetRoles.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/GetRoles.cs @@ -39,9 +39,9 @@ public async Task GetRolesWithUser() { var context = new MongoTestContext(GetConnection()); var store = new MongoUserStore(context); - var user = await store.FindByIdAsync(TestIds.UserId1); + var user = await store.FindByIdAsync(TestIds.UserId1, TestContext.Current.CancellationToken); - var roles = await store.GetRolesAsync(user); + var roles = await store.GetRolesAsync(user, TestContext.Current.CancellationToken); roles.Count.Should().Be(2); roles[0].Should().Be("Role 1"); diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/IdentitySpecTests.cs b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/IdentitySpecTests.cs index b4a7405..605df36 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/IdentitySpecTests.cs +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoUserStoreTests/IdentitySpecTests.cs @@ -84,32 +84,32 @@ public async Task SqlUserStoreMethodsThrowWhenDisposedTest() { var store = new MongoUserStore(CreateContext()); store.Dispose(); - await Assert.ThrowsAsync(async () => await store.AddClaimsAsync(null, null)); - await Assert.ThrowsAsync(async () => await store.AddLoginAsync(null, null)); - await Assert.ThrowsAsync(async () => await store.AddToRoleAsync(null, null)); - await Assert.ThrowsAsync(async () => await store.GetClaimsAsync(null)); - await Assert.ThrowsAsync(async () => await store.GetLoginsAsync(null)); - await Assert.ThrowsAsync(async () => await store.GetRolesAsync(null)); - await Assert.ThrowsAsync(async () => await store.IsInRoleAsync(null, null)); - await Assert.ThrowsAsync(async () => await store.RemoveClaimsAsync(null, null)); - await Assert.ThrowsAsync(async () => await store.RemoveLoginAsync(null, null, null)); + await Assert.ThrowsAsync(async () => await store.AddClaimsAsync(null, null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.AddLoginAsync(null, null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.AddToRoleAsync(null, null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.GetClaimsAsync(null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.GetLoginsAsync(null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.GetRolesAsync(null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.IsInRoleAsync(null, null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.RemoveClaimsAsync(null, null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.RemoveLoginAsync(null, null, null, TestContext.Current.CancellationToken)); await Assert.ThrowsAsync( - async () => await store.RemoveFromRoleAsync(null, null)); - await Assert.ThrowsAsync(async () => await store.RemoveClaimsAsync(null, null)); - await Assert.ThrowsAsync(async () => await store.ReplaceClaimAsync(null, null, null)); - await Assert.ThrowsAsync(async () => await store.FindByLoginAsync(null, null)); - await Assert.ThrowsAsync(async () => await store.FindByIdAsync(null)); - await Assert.ThrowsAsync(async () => await store.FindByNameAsync(null)); - await Assert.ThrowsAsync(async () => await store.CreateAsync(null)); - await Assert.ThrowsAsync(async () => await store.UpdateAsync(null)); - await Assert.ThrowsAsync(async () => await store.DeleteAsync(null)); + async () => await store.RemoveFromRoleAsync(null, null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.RemoveClaimsAsync(null, null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.ReplaceClaimAsync(null, null, null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.FindByLoginAsync(null, null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.FindByIdAsync(null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.FindByNameAsync(null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.CreateAsync(null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.UpdateAsync(null, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.DeleteAsync(null, TestContext.Current.CancellationToken)); await Assert.ThrowsAsync( - async () => await store.SetEmailConfirmedAsync(null, true)); - await Assert.ThrowsAsync(async () => await store.GetEmailConfirmedAsync(null)); + async () => await store.SetEmailConfirmedAsync(null, true, TestContext.Current.CancellationToken)); + await Assert.ThrowsAsync(async () => await store.GetEmailConfirmedAsync(null, TestContext.Current.CancellationToken)); await Assert.ThrowsAsync( - async () => await store.SetPhoneNumberConfirmedAsync(null, true)); + async () => await store.SetPhoneNumberConfirmedAsync(null, true, TestContext.Current.CancellationToken)); await Assert.ThrowsAsync( - async () => await store.GetPhoneNumberConfirmedAsync(null)); + async () => await store.GetPhoneNumberConfirmedAsync(null, TestContext.Current.CancellationToken)); } [Fact] From 1cff1036480a52accc7a2adfa73756803b75c7d2 Mon Sep 17 00:00:00 2001 From: John Campion Jr Date: Mon, 27 Oct 2025 21:50:37 -0400 Subject: [PATCH 4/6] update to stable xunit --- .../MongoEntityFramework.AspNetCore.Identity.Tests.csproj | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoEntityFramework.AspNetCore.Identity.Tests.csproj b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoEntityFramework.AspNetCore.Identity.Tests.csproj index 062c366..c1629da 100644 --- a/tests/MongoFramework.AspNetCore.Identity.Tests/MongoEntityFramework.AspNetCore.Identity.Tests.csproj +++ b/tests/MongoFramework.AspNetCore.Identity.Tests/MongoEntityFramework.AspNetCore.Identity.Tests.csproj @@ -19,15 +19,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - From 4e6daecf2fe3291ca83d7fa2a73cb801b917eb2f Mon Sep 17 00:00:00 2001 From: John Campion Jr Date: Mon, 27 Oct 2025 21:53:05 -0400 Subject: [PATCH 5/6] fix warning --- Net9MultiTenant/Pages/NoTenant.cshtml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Net9MultiTenant/Pages/NoTenant.cshtml.cs b/Net9MultiTenant/Pages/NoTenant.cshtml.cs index cca0e8d..a1e06ba 100644 --- a/Net9MultiTenant/Pages/NoTenant.cshtml.cs +++ b/Net9MultiTenant/Pages/NoTenant.cshtml.cs @@ -11,7 +11,7 @@ namespace Net9MultiTenant.Pages public class NoTenantModel() : PageModel { [ExcludeFromMultiTenantResolution] - public async Task OnGet() + public void OnGet() { } From ee8749d59f03357d76871d57673837a8498a6d94 Mon Sep 17 00:00:00 2001 From: John Campion Jr Date: Mon, 27 Oct 2025 21:55:07 -0400 Subject: [PATCH 6/6] update workflow --- .github/workflows/dotnet-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dotnet-test.yml b/.github/workflows/dotnet-test.yml index a91aabf..2c9a066 100644 --- a/.github/workflows/dotnet-test.yml +++ b/.github/workflows/dotnet-test.yml @@ -5,6 +5,7 @@ on: branches: [main] pull_request: branches: [main] + workflow_dispatch: jobs: build: