mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 08:32:50 -05:00
Add PlanSponsorshipType to db model
This commit is contained in:
@ -44,7 +44,7 @@ namespace Bit.Api.Test.Controllers
|
||||
Assert.Contains("Specified Organization cannot sponsor other organizations.", exception.Message);
|
||||
await sutProvider.GetDependency<IOrganizationSponsorshipService>()
|
||||
.DidNotReceiveWithAnyArgs()
|
||||
.OfferSponsorshipAsync(default, default, default);
|
||||
.OfferSponsorshipAsync(default, default, default, default);
|
||||
}
|
||||
|
||||
public static IEnumerable<object[]> NonConfirmedOrganizationUsersStatuses =>
|
||||
@ -73,7 +73,7 @@ namespace Bit.Api.Test.Controllers
|
||||
Assert.Contains("Only confirm users can sponsor other organizations.", exception.Message);
|
||||
await sutProvider.GetDependency<IOrganizationSponsorshipService>()
|
||||
.DidNotReceiveWithAnyArgs()
|
||||
.OfferSponsorshipAsync(default, default, default);
|
||||
.OfferSponsorshipAsync(default, default, default, default);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -96,7 +96,7 @@ namespace Bit.Api.Test.Controllers
|
||||
Assert.Contains("Can only create organization sponsorships for yourself.", exception.Message);
|
||||
await sutProvider.GetDependency<IOrganizationSponsorshipService>()
|
||||
.DidNotReceiveWithAnyArgs()
|
||||
.OfferSponsorshipAsync(default, default, default);
|
||||
.OfferSponsorshipAsync(default, default, default, default);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -121,7 +121,7 @@ namespace Bit.Api.Test.Controllers
|
||||
Assert.Contains("Can only sponsor one organization per Organization User.", exception.Message);
|
||||
await sutProvider.GetDependency<IOrganizationSponsorshipService>()
|
||||
.DidNotReceiveWithAnyArgs()
|
||||
.OfferSponsorshipAsync(default, default, default);
|
||||
.OfferSponsorshipAsync(default, default, default, default);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Table;
|
||||
using Bit.Core.Repositories;
|
||||
using Bit.Core.Services;
|
||||
@ -35,7 +36,8 @@ namespace Bit.Core.Test.Services
|
||||
public async Task OfferSponsorship_CreatesSponsorship(Organization sponsoringOrg, OrganizationUser sponsoringOrgUser,
|
||||
string sponsoredEmail, SutProvider<OrganizationSponsorshipService> sutProvider)
|
||||
{
|
||||
await sutProvider.Sut.OfferSponsorshipAsync(sponsoringOrg, sponsoringOrgUser, sponsoredEmail);
|
||||
await sutProvider.Sut.OfferSponsorshipAsync(sponsoringOrg, sponsoringOrgUser,
|
||||
PlanSponsorshipType.FamiliesForEnterprise, sponsoredEmail);
|
||||
|
||||
var expectedSponsorship = new OrganizationSponsorship
|
||||
{
|
||||
@ -64,7 +66,9 @@ namespace Bit.Core.Test.Services
|
||||
return expectedException;
|
||||
});
|
||||
|
||||
var actualException = await Assert.ThrowsAsync<Exception>(() => sutProvider.Sut.OfferSponsorshipAsync(sponsoringOrg, sponsoringOrgUser, sponsoredEmail));
|
||||
var actualException = await Assert.ThrowsAsync<Exception>(() =>
|
||||
sutProvider.Sut.OfferSponsorshipAsync(sponsoringOrg, sponsoringOrgUser,
|
||||
PlanSponsorshipType.FamiliesForEnterprise, sponsoredEmail));
|
||||
Assert.Same(expectedException, actualException);
|
||||
|
||||
await sutProvider.GetDependency<IOrganizationSponsorshipRepository>().Received(1)
|
||||
|
Reference in New Issue
Block a user