mirror of
https://github.com/bitwarden/server.git
synced 2025-04-04 20:50:21 -05:00
PasswordManagerInviteUserValidation to PasswordManagerInviteUserValidator
This commit is contained in:
parent
f0770eda93
commit
038c00d21f
@ -38,7 +38,7 @@ public class InviteUsersValidator(
|
||||
}
|
||||
|
||||
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(request);
|
||||
var passwordManagerValidationResult = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
||||
var passwordManagerValidationResult = PasswordManagerInviteUserValidator.Validate(subscriptionUpdate);
|
||||
|
||||
if (passwordManagerValidationResult is Invalid<PasswordManagerSubscriptionUpdate> invalidSubscriptionUpdate)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers.Validation.PasswordManager;
|
||||
|
||||
public static class PasswordManagerInviteUserValidation
|
||||
public static class PasswordManagerInviteUserValidator
|
||||
{
|
||||
// NOTE This is only for validating adding users to an organization, not removing
|
||||
public static ValidationResult<PasswordManagerSubscriptionUpdate> Validate(PasswordManagerSubscriptionUpdate subscriptionUpdate)
|
@ -10,7 +10,7 @@ using Xunit;
|
||||
namespace Bit.Core.Test.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers.Validation;
|
||||
|
||||
|
||||
public class PasswordManagerInviteUserValidationTests
|
||||
public class PasswordManagerInviteUserValidatorTests
|
||||
{
|
||||
[Theory]
|
||||
[BitAutoData]
|
||||
@ -22,7 +22,7 @@ public class PasswordManagerInviteUserValidationTests
|
||||
|
||||
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, 0, 0);
|
||||
|
||||
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
||||
var result = PasswordManagerInviteUserValidator.Validate(subscriptionUpdate);
|
||||
|
||||
Assert.IsType<Valid<PasswordManagerSubscriptionUpdate>>(result);
|
||||
}
|
||||
@ -40,7 +40,7 @@ public class PasswordManagerInviteUserValidationTests
|
||||
|
||||
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, seatsOccupiedByUsers, additionalSeats);
|
||||
|
||||
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
||||
var result = PasswordManagerInviteUserValidator.Validate(subscriptionUpdate);
|
||||
|
||||
Assert.IsType<Valid<PasswordManagerSubscriptionUpdate>>(result);
|
||||
}
|
||||
@ -59,7 +59,7 @@ public class PasswordManagerInviteUserValidationTests
|
||||
|
||||
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, seatsOccupiedByUsers, additionalSeats);
|
||||
|
||||
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
||||
var result = PasswordManagerInviteUserValidator.Validate(subscriptionUpdate);
|
||||
|
||||
Assert.IsType<Invalid<PasswordManagerSubscriptionUpdate>>(result);
|
||||
Assert.Equal(PasswordManagerSeatLimitHasBeenReachedError.Code, (result as Invalid<PasswordManagerSubscriptionUpdate>)!.ErrorMessageString);
|
||||
@ -79,7 +79,7 @@ public class PasswordManagerInviteUserValidationTests
|
||||
|
||||
var subscriptionUpdate = new PasswordManagerSubscriptionUpdate(organizationDto, seatsOccupiedByUsers, additionalSeats);
|
||||
|
||||
var result = PasswordManagerInviteUserValidation.Validate(subscriptionUpdate);
|
||||
var result = PasswordManagerInviteUserValidator.Validate(subscriptionUpdate);
|
||||
|
||||
Assert.IsType<Invalid<PasswordManagerSubscriptionUpdate>>(result);
|
||||
Assert.Equal(PasswordManagerPlanDoesNotAllowAdditionalSeatsError.Code, (result as Invalid<PasswordManagerSubscriptionUpdate>)!.ErrorMessageString);
|
Loading…
x
Reference in New Issue
Block a user