1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 05:00:19 -05:00

Rename for InvitingUserOrganizationValidation to InvitingUserOrganizationValidator

This commit is contained in:
jrmccannon 2025-03-24 12:35:16 -05:00
parent 982611bd1b
commit f0770eda93
No known key found for this signature in database
GPG Key ID: CF03F3DB01CE96A6
3 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ public class InviteUsersValidator(
return invalidEnvironment.Map(request); return invalidEnvironment.Map(request);
} }
var organizationValidationResult = InvitingUserOrganizationValidation.Validate(request.InviteOrganization); var organizationValidationResult = InvitingUserOrganizationValidator.Validate(request.InviteOrganization);
if (organizationValidationResult is Invalid<InviteOrganization> organizationValidation) if (organizationValidationResult is Invalid<InviteOrganization> organizationValidation)
{ {

View File

@ -3,7 +3,7 @@ using Bit.Core.AdminConsole.Shared.Validation;
namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers.Validation.Organization; namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers.Validation.Organization;
public static class InvitingUserOrganizationValidation public static class InvitingUserOrganizationValidator
{ {
public static ValidationResult<InviteOrganization> Validate(InviteOrganization inviteOrganization) public static ValidationResult<InviteOrganization> Validate(InviteOrganization inviteOrganization)
{ {

View File

@ -14,7 +14,7 @@ public class InviteUserOrganizationValidationTests
[BitAutoData] [BitAutoData]
public void Validate_WhenOrganizationIsFreeTier_ShouldReturnValidResponse(Organization organization) public void Validate_WhenOrganizationIsFreeTier_ShouldReturnValidResponse(Organization organization)
{ {
var result = InvitingUserOrganizationValidation.Validate(new InviteOrganization(organization, new FreePlan())); var result = InvitingUserOrganizationValidator.Validate(new InviteOrganization(organization, new FreePlan()));
Assert.IsType<Valid<InviteOrganization>>(result); Assert.IsType<Valid<InviteOrganization>>(result);
} }
@ -26,7 +26,7 @@ public class InviteUserOrganizationValidationTests
{ {
organization.GatewayCustomerId = string.Empty; organization.GatewayCustomerId = string.Empty;
var result = InvitingUserOrganizationValidation.Validate(new InviteOrganization(organization, new FreePlan())); var result = InvitingUserOrganizationValidator.Validate(new InviteOrganization(organization, new FreePlan()));
Assert.IsType<Invalid<InviteOrganization>>(result); Assert.IsType<Invalid<InviteOrganization>>(result);
Assert.Equal(OrganizationNoPaymentMethodFoundError.Code, (result as Invalid<InviteOrganization>)!.ErrorMessageString); Assert.Equal(OrganizationNoPaymentMethodFoundError.Code, (result as Invalid<InviteOrganization>)!.ErrorMessageString);
@ -39,7 +39,7 @@ public class InviteUserOrganizationValidationTests
{ {
organization.GatewaySubscriptionId = string.Empty; organization.GatewaySubscriptionId = string.Empty;
var result = InvitingUserOrganizationValidation.Validate(new InviteOrganization(organization, new FreePlan())); var result = InvitingUserOrganizationValidator.Validate(new InviteOrganization(organization, new FreePlan()));
Assert.IsType<Invalid<InviteOrganization>>(result); Assert.IsType<Invalid<InviteOrganization>>(result);
Assert.Equal(OrganizationNoSubscriptionFoundError.Code, (result as Invalid<InviteOrganization>)!.ErrorMessageString); Assert.Equal(OrganizationNoSubscriptionFoundError.Code, (result as Invalid<InviteOrganization>)!.ErrorMessageString);