From c0ca8ba24799f91ee0661ba6ff38cca7097c292a Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 26 Nov 2024 14:03:09 -0500 Subject: [PATCH] fix tests --- .../DeleteManagedOrganizationUserAccountCommandTests.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/Core.Test/AdminConsole/OrganizationFeatures/OrganizationUsers/DeleteManagedOrganizationUserAccountCommandTests.cs b/test/Core.Test/AdminConsole/OrganizationFeatures/OrganizationUsers/DeleteManagedOrganizationUserAccountCommandTests.cs index 0fdfad615f..fe2f3ae2a6 100644 --- a/test/Core.Test/AdminConsole/OrganizationFeatures/OrganizationUsers/DeleteManagedOrganizationUserAccountCommandTests.cs +++ b/test/Core.Test/AdminConsole/OrganizationFeatures/OrganizationUsers/DeleteManagedOrganizationUserAccountCommandTests.cs @@ -313,8 +313,8 @@ public class DeleteManagedOrganizationUserAccountCommandTests Assert.All(results, r => Assert.Empty(r.Item2)); await sutProvider.GetDependency().Received(1).GetManyAsync(userIds); - await sutProvider.GetDependency().Received(0).DeleteManyAsync(Arg.Any>()); - await sutProvider.GetDependency().Received(2).DeleteAsync(Arg.Any()); + await sutProvider.GetDependency().Received(1).DeleteManyAsync(Arg.Is>(list => list.Count() == 2)); + await sutProvider.GetDependency().Received(0).DeleteAsync(Arg.Any()); await sutProvider.GetDependency().Received(1).LogOrganizationUserEventsAsync( Arg.Is>(events => events.Count(e => e.Item1.Id == orgUser1.Id && e.Item2 == EventType.OrganizationUser_Deleted) == 1 @@ -351,10 +351,11 @@ public class DeleteManagedOrganizationUserAccountCommandTests Guid organizationId, Guid orgUserId) { - // Arrang + // Arrange sutProvider.GetDependency() .IsEnabled(FeatureFlagKeys.AccountDeprovisioning).Returns(false); + var usersToDelete = new List(); // Act var result = await sutProvider.Sut.DeleteManyUsersAsync(organizationId, new[] { orgUserId }, null); @@ -362,7 +363,7 @@ public class DeleteManagedOrganizationUserAccountCommandTests Assert.Single(result); Assert.Equal(orgUserId, result.First().Item1); Assert.Contains("Member not found.", result.First().Item2); - await sutProvider.GetDependency().Received(0).DeleteManyAsync(Arg.Any>()); + await sutProvider.GetDependency().Received(1).DeleteManyAsync(Arg.Is>(list => list.Count() == 0)); await sutProvider.GetDependency().Received(0).DeleteAsync(Arg.Any()); await sutProvider.GetDependency().Received(0) .LogOrganizationUserEventsAsync(Arg.Any>());