mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 08:32:50 -05:00
[AC-1923] Add endpoint to create client organization (#3977)
* Add new endpoint for creating client organizations in consolidated billing * Create empty org and then assign seats for code re-use * Fixes made from debugging client side * few more small fixes * Vincent's feedback
This commit is contained in:
63
test/Api.Test/Utilities/EnumMatchesAttributeTests.cs
Normal file
63
test/Api.Test/Utilities/EnumMatchesAttributeTests.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using Bit.Api.Utilities;
|
||||
using Bit.Core.Enums;
|
||||
using Xunit;
|
||||
|
||||
namespace Bit.Api.Test.Utilities;
|
||||
|
||||
public class EnumMatchesAttributeTests
|
||||
{
|
||||
[Fact]
|
||||
public void IsValid_NullInput_False()
|
||||
{
|
||||
var enumMatchesAttribute =
|
||||
new EnumMatchesAttribute<PlanType>(PlanType.TeamsMonthly, PlanType.EnterpriseMonthly);
|
||||
|
||||
var result = enumMatchesAttribute.IsValid(null);
|
||||
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsValid_NullAccepted_False()
|
||||
{
|
||||
var enumMatchesAttribute =
|
||||
new EnumMatchesAttribute<PlanType>();
|
||||
|
||||
var result = enumMatchesAttribute.IsValid(PlanType.TeamsMonthly);
|
||||
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsValid_EmptyAccepted_False()
|
||||
{
|
||||
var enumMatchesAttribute =
|
||||
new EnumMatchesAttribute<PlanType>([]);
|
||||
|
||||
var result = enumMatchesAttribute.IsValid(PlanType.TeamsMonthly);
|
||||
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsValid_ParseFails_False()
|
||||
{
|
||||
var enumMatchesAttribute =
|
||||
new EnumMatchesAttribute<PlanType>(PlanType.TeamsMonthly, PlanType.EnterpriseMonthly);
|
||||
|
||||
var result = enumMatchesAttribute.IsValid(GatewayType.Stripe);
|
||||
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsValid_Matches_True()
|
||||
{
|
||||
var enumMatchesAttribute =
|
||||
new EnumMatchesAttribute<PlanType>(PlanType.TeamsMonthly, PlanType.EnterpriseMonthly);
|
||||
|
||||
var result = enumMatchesAttribute.IsValid(PlanType.TeamsMonthly);
|
||||
|
||||
Assert.True(result);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user