public async Task AndOneSummaryFoundAndFirstAndSecondCallToApiFails_ThenShouldCallSendEmailToAllProviderRecipientsUsingRetryPolicy() { var f = new WhenSendingProviderAlertSummaryEmailsFixture().WithOneSummaryAlert().WithFirstAndSecondApiCallsFailure(); await f.Sut.SendAlertSummaryEmails(f.JobId); f.VerifySendEmailToAllProviderRecipientsIsCalledNTimeWithSummaryAlert(f.FirstAlertSummary, 3); }
public async Task AndTwoDuplicateSummariesFound_ThenShouldCallSendEmailToAllProviderRecipientsOnce() { var f = new WhenSendingProviderAlertSummaryEmailsFixture().WithDuplicateSummaryAlert(); await f.Sut.SendAlertSummaryEmails(f.JobId); f.VerifySendEmailToAllProviderRecipientsIsCalledOnceWithSummaryAlert(f.FirstAlertSummary); }
public async Task AndDifferentSummariesFound_ThenShouldCallSendEmailToAllProviderRecipientsOnceForEachProvider() { var f = new WhenSendingProviderAlertSummaryEmailsFixture().WithMultipleSummaryAlerts(); await f.Sut.SendAlertSummaryEmails(f.JobId); f.VerifySendEmailToAllProviderRecipientsIsCalledOnceWithSummaryAlertForEachProvider(); }
public async Task AndNoSummariesFound_ThenShouldNotCallSendEmailToAllProviderRecipients() { var f = new WhenSendingProviderAlertSummaryEmailsFixture(); await f.Sut.SendAlertSummaryEmails(f.JobId); f.VerifySendEmailToAllProviderRecipientsIsNeverCalled(); }