public void ProviderApprovedCohort_ThrowsExceptionAndLogsIt_WhenPublishingFails()
        {
            var f = new NotificationsPublisherTestsFixtures().SetupMessageSessionToThrowInvalidOperationException();

            Assert.ThrowsAsync <InvalidOperationException>(() => f.Sut.ProviderApprovedCohort(f.Commitment));
            f.VerifyExceptionIsLogged <InvalidOperationException>();
        }
        public async Task ProviderApprovedCohort_PublishedSendEmailToEmployerCommandForTransferSender_WithCorrectTokens()
        {
            var f = new NotificationsPublisherTestsFixtures().SetTransferSenderIdAndLastActionToApprove(1234).SetupEncodingService();
            await f.Sut.ProviderApprovedCohort(f.Commitment);

            f.VerifyTokensForTransferApproval();
        }
        public async Task ProviderAmendedCohort_PublishedSendEmailToEmployerCommand_WithCorrectTokens()
        {
            var f = new NotificationsPublisherTestsFixtures().SetupEncodingService();
            await f.Sut.ProviderAmendedCohort(f.Commitment);

            f.VerifyTokensForAmendedTemplate();
        }
        public async Task ProviderApprovedCohort_PublishedSendEmailToEmployerCommand_WithCorrectTemplate(long?transferSenderId, string expectedTemplate)
        {
            var f = new NotificationsPublisherTestsFixtures().SetTransferSenderIdAndLastActionToApprove(transferSenderId);
            await f.Sut.ProviderApprovedCohort(f.Commitment);

            f.VerifyTemplateIsUsed(expectedTemplate);
        }
        public async Task ProviderAmendedCohort_PublishedSendEmailToEmployerCommand_WithCorrectTemplate()
        {
            var f = new NotificationsPublisherTestsFixtures();
            await f.Sut.ProviderAmendedCohort(f.Commitment);

            f.VerifyTemplateIsUsed(NotificationsPublisher.AmendedTemplate);
        }