diff --git a/src/Core/Services/Implementations/OrganizationService.cs b/src/Core/Services/Implementations/OrganizationService.cs index 73eb98cd0..cc504ae02 100644 --- a/src/Core/Services/Implementations/OrganizationService.cs +++ b/src/Core/Services/Implementations/OrganizationService.cs @@ -1811,9 +1811,9 @@ public class OrganizationService : IOrganizationService private static void ValidatePlan(Models.StaticStore.Plan plan, int additionalSeats, string productType) { - if (plan is not { LegacyYear: null }) + if (plan is null) { - throw new BadRequestException($"Invalid {productType} plan selected."); + throw new BadRequestException($"{productType} Plan was null."); } if (plan.Disabled) @@ -1829,6 +1829,11 @@ public class OrganizationService : IOrganizationService public void ValidatePasswordManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade) { + if (plan is not { LegacyYear: null }) + { + throw new BadRequestException("Invalid Password Manager plan selected."); + } + ValidatePlan(plan, upgrade.AdditionalSeats, "Password Manager"); if (plan.PasswordManager.BaseSeats + upgrade.AdditionalSeats <= 0) diff --git a/test/Core.Test/Services/OrganizationServiceTests.cs b/test/Core.Test/Services/OrganizationServiceTests.cs index a7428697f..b0421309b 100644 --- a/test/Core.Test/Services/OrganizationServiceTests.cs +++ b/test/Core.Test/Services/OrganizationServiceTests.cs @@ -1788,25 +1788,6 @@ public class OrganizationServiceTests Assert.Equal(includeProvider, result); } - [Theory] - [BitAutoData(PlanType.EnterpriseAnnually2019)] - public void ValidateSecretsManagerPlan_ThrowsException_WhenInvalidPlanSelected( - PlanType planType, SutProvider sutProvider) - { - var plan = StaticStore.GetPlan(planType); - - var signup = new OrganizationUpgrade - { - UseSecretsManager = true, - AdditionalSmSeats = 1, - AdditionalServiceAccounts = 10, - AdditionalSeats = 1 - }; - - var exception = Assert.Throws(() => sutProvider.Sut.ValidateSecretsManagerPlan(plan, signup)); - Assert.Contains("Invalid Secrets Manager plan selected.", exception.Message); - } - [Theory] [BitAutoData(PlanType.TeamsAnnually)] [BitAutoData(PlanType.TeamsMonthly)]