diff --git a/test/Api.Test/AdminConsole/Controllers/OrganizationUsersControllerTests.cs b/test/Api.Test/AdminConsole/Controllers/OrganizationUsersControllerTests.cs index baf23bb9c..85ef4361f 100644 --- a/test/Api.Test/AdminConsole/Controllers/OrganizationUsersControllerTests.cs +++ b/test/Api.Test/AdminConsole/Controllers/OrganizationUsersControllerTests.cs @@ -31,7 +31,7 @@ public class OrganizationUsersControllerTests await sutProvider.Sut.PutResetPasswordEnrollment(orgId, userId, model); - await sutProvider.GetDependency().Received(1).AcceptOrgUserByOrgIdAsync(orgId, user, sutProvider.GetDependency()); + await sutProvider.GetDependency().Received(1).AcceptOrgUserAsync(orgUser, user, sutProvider.GetDependency()); } [Theory] @@ -45,7 +45,7 @@ public class OrganizationUsersControllerTests await sutProvider.Sut.PutResetPasswordEnrollment(orgId, userId, model); - await sutProvider.GetDependency().Received(0).AcceptOrgUserByOrgIdAsync(orgId, user, sutProvider.GetDependency()); + await sutProvider.GetDependency().Received(0).AcceptOrgUserAsync(orgUser, user, sutProvider.GetDependency()); } [Theory] diff --git a/test/Core.Test/AdminConsole/OrganizationFeatures/OrganizationUsers/AcceptOrgUserCommandTests.cs b/test/Core.Test/AdminConsole/OrganizationFeatures/OrganizationUsers/AcceptOrgUserCommandTests.cs index eca4f449b..205ac8703 100644 --- a/test/Core.Test/AdminConsole/OrganizationFeatures/OrganizationUsers/AcceptOrgUserCommandTests.cs +++ b/test/Core.Test/AdminConsole/OrganizationFeatures/OrganizationUsers/AcceptOrgUserCommandTests.cs @@ -183,7 +183,7 @@ public class AcceptOrgUserCommandTests } - // AcceptOrgUserByOrgIdAsync tests -------------------------------------------------------------------------------- + // AcceptOrgUserByEmailTokenAsync tests -------------------------------------------------------------------------------- [Theory] [EphemeralDataProtectionAutoData] @@ -482,71 +482,6 @@ public class AcceptOrgUserCommandTests Assert.Equal("User not found within organization.", exception.Message); } - // AcceptOrgUserByOrgIdAsync --------------------------------------------------------------------------------------- - - [Theory] - [BitAutoData] - public async Task AcceptOrgUserByOrgId_ValidData_AcceptsOrgUser( - SutProvider sutProvider, - User user, Organization org, OrganizationUser orgUser, OrganizationUserUserDetails adminUserDetails) - { - // Arrange - SetupCommonAcceptOrgUserMocks(sutProvider, user, org, orgUser, adminUserDetails); - - sutProvider.GetDependency() - .GetByIdAsync(org.Id) - .Returns(org); - - sutProvider.GetDependency() - .GetByOrganizationAsync(org.Id, user.Id) - .Returns(orgUser); - - // Act - var resultOrgUser = await sutProvider.Sut.AcceptOrgUserByOrgIdAsync(org.Id, user, _userService); - - // Assert - AssertValidAcceptedOrgUser(resultOrgUser, orgUser, user); - } - - [Theory] - [BitAutoData] - public async Task AcceptOrgUserByOrgId_InvalidOrg_ThrowsBadRequest(SutProvider sutProvider, - Guid orgId, User user) - { - // Arrange - - sutProvider.GetDependency() - .GetByIdAsync(orgId) - .Returns((Organization)null); - - // Act & Assert - var exception = await Assert.ThrowsAsync( - () => sutProvider.Sut.AcceptOrgUserByOrgIdAsync(orgId, user, _userService)); - - Assert.Equal("Organization invalid.", exception.Message); - } - - [Theory] - [BitAutoData] - public async Task AcceptOrgUserByOrgId_UserNotInOrg_ThrowsBadRequest(SutProvider sutProvider, - Organization org, User user) - { - // Arrange - sutProvider.GetDependency() - .GetByIdAsync(org.Id) - .Returns(org); - - sutProvider.GetDependency() - .GetByOrganizationAsync(org.Id, user.Id) - .Returns((OrganizationUser)null); - - // Act & Assert - var exception = await Assert.ThrowsAsync( - () => sutProvider.Sut.AcceptOrgUserByOrgIdAsync(org.Id, user, _userService)); - - Assert.Equal("User not found within organization.", exception.Message); - } - // Private helpers ------------------------------------------------------------------------------------------------- ///