1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-29 13:25:17 +01:00

Fix tests

This commit is contained in:
Justin Baur 2021-11-15 14:47:23 -05:00
parent afa53fcccd
commit 6dab6d3428

View File

@ -73,7 +73,7 @@ namespace Bit.Core.Test.Services
await sutProvider.GetDependency<IMailService>().Received(1). await sutProvider.GetDependency<IMailService>().Received(1).
SendFamiliesForEnterpriseOfferEmailAsync(sponsoredEmail, sponsoringOrg.Name, SendFamiliesForEnterpriseOfferEmailAsync(sponsoredEmail, sponsoringOrg.Name,
Arg.Any<string>()); false, Arg.Any<string>());
} }
[Theory] [Theory]
@ -104,10 +104,14 @@ namespace Bit.Core.Test.Services
public async Task SendSponsorshipOfferAsync(Organization org, OrganizationSponsorship sponsorship, public async Task SendSponsorshipOfferAsync(Organization org, OrganizationSponsorship sponsorship,
SutProvider<OrganizationSponsorshipService> sutProvider) SutProvider<OrganizationSponsorshipService> sutProvider)
{ {
sutProvider.GetDependency<IUserRepository>()
.GetByEmailAsync(sponsorship.OfferedToEmail)
.Returns(Task.FromResult(new User()));
await sutProvider.Sut.SendSponsorshipOfferAsync(org, sponsorship); await sutProvider.Sut.SendSponsorshipOfferAsync(org, sponsorship);
await sutProvider.GetDependency<IMailService>().Received(1) await sutProvider.GetDependency<IMailService>().Received(1)
.SendFamiliesForEnterpriseOfferEmailAsync(sponsorship.OfferedToEmail, org.Name, Arg.Any<string>()); .SendFamiliesForEnterpriseOfferEmailAsync(sponsorship.OfferedToEmail, org.Name, true, Arg.Any<string>());
} }
private async Task AssertRemovedSponsoredPaymentAsync(Organization sponsoredOrg, private async Task AssertRemovedSponsoredPaymentAsync(Organization sponsoredOrg,