mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
Fixed tests.
This commit is contained in:
parent
a2b155e81c
commit
829e49c398
@ -12,10 +12,9 @@ public class InviteOrganizationUserRequestTests
|
||||
{
|
||||
[Theory]
|
||||
[BitAutoData]
|
||||
public void Create_WhenPassedInvalidEmail_ThrowsException(string email,
|
||||
OrganizationUserType type, Permissions permissions, bool accessSecretsManager)
|
||||
public void Create_WhenPassedInvalidEmail_ThrowsException(string email, OrganizationUserType type, Permissions permissions)
|
||||
{
|
||||
var action = () => new OrganizationUserSingleEmailInvite(email, [], type, permissions, accessSecretsManager);
|
||||
var action = () => new OrganizationUserSingleEmailInvite(email, [], type, permissions);
|
||||
|
||||
var exception = Assert.Throws<BadRequestException>(action);
|
||||
|
||||
@ -24,13 +23,13 @@ public class InviteOrganizationUserRequestTests
|
||||
|
||||
[Theory]
|
||||
[BitAutoData]
|
||||
public void Create_WhenPassedInvalidCollectionAccessConfiguration_ThrowsException(OrganizationUserType type, Permissions permissions, bool accessSecretsManager)
|
||||
public void Create_WhenPassedInvalidCollectionAccessConfiguration_ThrowsException(OrganizationUserType type, Permissions permissions)
|
||||
{
|
||||
var validEmail = "test@email.com";
|
||||
|
||||
var invalidCollectionConfiguration = new CollectionAccessSelection { Manage = true, HidePasswords = true };
|
||||
|
||||
var action = () => new OrganizationUserSingleEmailInvite(validEmail, [invalidCollectionConfiguration], type, permissions, accessSecretsManager);
|
||||
var action = () => new OrganizationUserSingleEmailInvite(validEmail, [invalidCollectionConfiguration], type, permissions);
|
||||
|
||||
var exception = Assert.Throws<BadRequestException>(action);
|
||||
|
||||
@ -39,12 +38,12 @@ public class InviteOrganizationUserRequestTests
|
||||
|
||||
[Theory]
|
||||
[BitAutoData]
|
||||
public void Create_WhenPassedValidArguments_ReturnsInvite(OrganizationUserType type, Permissions permissions, bool accessSecretsManager)
|
||||
public void Create_WhenPassedValidArguments_ReturnsInvite(OrganizationUserType type, Permissions permissions)
|
||||
{
|
||||
const string validEmail = "test@email.com";
|
||||
var validCollectionConfiguration = new CollectionAccessSelection { Id = Guid.NewGuid(), Manage = true };
|
||||
|
||||
var invite = new OrganizationUserSingleEmailInvite(validEmail, [validCollectionConfiguration], type, permissions, accessSecretsManager);
|
||||
var invite = new OrganizationUserSingleEmailInvite(validEmail, [validCollectionConfiguration], type, permissions);
|
||||
|
||||
Assert.NotNull(invite);
|
||||
Assert.Equal(validEmail, invite.Email);
|
||||
|
@ -14,7 +14,7 @@ public static class InviteUserOrganizationValidationRequestHelpers
|
||||
Invites =
|
||||
[
|
||||
OrganizationUserInviteDto.Create(request.Email,
|
||||
OrganizationUserInvite.Create(request), inviteOrganization.OrganizationId)
|
||||
OrganizationUserInvite.Create(request, inviteOrganization.UseSecretsManager), inviteOrganization.OrganizationId)
|
||||
],
|
||||
InviteOrganization = inviteOrganization,
|
||||
PerformedBy = Guid.Empty,
|
||||
|
@ -44,7 +44,6 @@ public class InviteOrganizationUserCommandTests
|
||||
var organizationDto = new InviteOrganization(organization);
|
||||
|
||||
var request = new OrganizationUserSingleEmailInvite(user.Email,
|
||||
true,
|
||||
organizationDto,
|
||||
timeProvider.GetUtcNow(),
|
||||
externalId);
|
||||
@ -93,7 +92,6 @@ public class InviteOrganizationUserCommandTests
|
||||
var organizationDto = new InviteOrganization(organization);
|
||||
|
||||
var request = new OrganizationUserSingleEmailInvite(orgUser.Email,
|
||||
true,
|
||||
organizationDto,
|
||||
timeProvider.GetUtcNow(),
|
||||
externalId);
|
||||
@ -146,7 +144,6 @@ public class InviteOrganizationUserCommandTests
|
||||
var organizationDto = new InviteOrganization(organization);
|
||||
|
||||
var request = new OrganizationUserSingleEmailInvite(user.Email,
|
||||
true,
|
||||
organizationDto,
|
||||
timeProvider.GetUtcNow(),
|
||||
externalId);
|
||||
@ -201,7 +198,6 @@ public class InviteOrganizationUserCommandTests
|
||||
var organizationDto = new InviteOrganization(organization);
|
||||
|
||||
var request = new OrganizationUserSingleEmailInvite(user.Email,
|
||||
true,
|
||||
organizationDto,
|
||||
timeProvider.GetUtcNow(),
|
||||
externalId);
|
||||
@ -259,7 +255,6 @@ public class InviteOrganizationUserCommandTests
|
||||
var organizationDto = new InviteOrganization(organization);
|
||||
|
||||
var request = new OrganizationUserSingleEmailInvite(user.Email,
|
||||
true,
|
||||
organizationDto,
|
||||
timeProvider.GetUtcNow(),
|
||||
externalId);
|
||||
@ -322,7 +317,6 @@ public class InviteOrganizationUserCommandTests
|
||||
var organizationDto = new InviteOrganization(organization);
|
||||
|
||||
var request = new OrganizationUserSingleEmailInvite(user.Email,
|
||||
true,
|
||||
organizationDto,
|
||||
timeProvider.GetUtcNow(),
|
||||
externalId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user