mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
Families for enterprise/fix new org sponsorship after deleted sponsored org (#1740)
* Sponsorship exists only if sponsored org is not null * Replace existing sponsorship if necessary * Update src/Core/Services/Implementations/OrganizationSponsorshipService.cs Co-authored-by: Robyn MacCallum <nickersthecat@gmail.com> * Fix tests Co-authored-by: Robyn MacCallum <nickersthecat@gmail.com>
This commit is contained in:
@ -139,7 +139,7 @@ namespace Bit.Core.Test.Services
|
||||
};
|
||||
|
||||
await sutProvider.GetDependency<IOrganizationSponsorshipRepository>().Received(1)
|
||||
.CreateAsync(Arg.Is<OrganizationSponsorship>(s => SponsorshipValidator(s, expectedSponsorship)));
|
||||
.UpsertAsync(Arg.Is<OrganizationSponsorship>(s => SponsorshipValidator(s, expectedSponsorship)));
|
||||
|
||||
await sutProvider.GetDependency<IMailService>().Received(1).
|
||||
SendFamiliesForEnterpriseOfferEmailAsync(sponsoredEmail, email,
|
||||
@ -156,7 +156,7 @@ namespace Bit.Core.Test.Services
|
||||
|
||||
var expectedException = new Exception();
|
||||
OrganizationSponsorship createdSponsorship = null;
|
||||
sutProvider.GetDependency<IOrganizationSponsorshipRepository>().CreateAsync(default).ThrowsForAnyArgs(callInfo =>
|
||||
sutProvider.GetDependency<IOrganizationSponsorshipRepository>().UpsertAsync(default).ThrowsForAnyArgs(callInfo =>
|
||||
{
|
||||
createdSponsorship = callInfo.ArgAt<OrganizationSponsorship>(0);
|
||||
createdSponsorship.Id = Guid.NewGuid();
|
||||
|
Reference in New Issue
Block a user