public async Task SendBankDetailRequiredEmail(long accountId, SendBankDetailsEmailRequest sendBankDetailsEmailRequest)
        {
            var request = new PostBankDetailsRequiredEmailRequest(accountId)
            {
                Data = sendBankDetailsEmailRequest
            };

            await _client.Post <SendBankDetailsEmailRequest>(request);
        }
        public async Task <Unit> Handle(SendBankDetailsRequiredEmailCommand command, CancellationToken cancellationToken)
        {
            var request = new PostBankDetailsRequiredEmailRequest
            {
                Data = new SendBankDetailsEmailRequest(command.AccountId, command.AccountLegalEntityId, command.EmailAddress, command.AddBankDetailsUrl)
            };

            await _emailService.SendEmail(request);

            return(Unit.Value);
        }
Пример #3
0
        public void Then_The_PostUrl_Is_Correctly_Build(long accountId, long accountLegalEntityId, string emailAddress, string addBankDetailsUrl, string baseUrl)
        {
            var request = new SendBankDetailsEmailRequest(accountId, accountLegalEntityId, emailAddress, addBankDetailsUrl);
            var actual  = new PostBankDetailsRequiredEmailRequest {
                Data = request
            };

            request.AccountId.Should().Be(accountId);
            request.AccountLegalEntityId.Should().Be(accountLegalEntityId);
            request.EmailAddress.Should().Be(emailAddress);
            request.AddBankDetailsUrl.Should().Be(addBankDetailsUrl);
            actual.PostUrl.Should().Be("api/EmailCommand/bank-details-required");
        }
Пример #4
0
        public async Task Then_The_InnerApi_Is_Called(
            PostBankDetailsRequiredEmailRequest requestData,
            [Frozen] Mock <IEmployerIncentivesApiClient <EmployerIncentivesConfiguration> > client,
            EmailService sut)
        {
            await sut.SendEmail <PostBankDetailsRequiredEmailRequest>(requestData);

            client.Verify(x =>
                          x.Post <PostBankDetailsRequiredEmailRequest>(It.Is <PostBankDetailsRequiredEmailRequest>(
                                                                           c => c.Data == requestData.Data &&
                                                                           c.PostUrl.Contains("bank-details-required")
                                                                           )), Times.Once);
        }