示例#1
0
        public async Task <IActionResult> SendRegistrationEmail([FromBody] RegistrationEmailDto model)
        {
            if (!ModelState.IsValid)
            {
                Forbid();
            }

            await _registerService.SendRegistrationEmailAsync(model);

            return(Ok());
        }
示例#2
0
        public void SendRegistrationEmailAsync_ShouldCallSendRegistrationEmailAsync_Once()
        {
            //Arrange
            var registrationEmailDto = new RegistrationEmailDto()
            {
                EmailAddress = It.IsAny <string>(),
                CallBackUrl  = It.IsAny <string>()
            };

            //Act
            var result = _registerService.SendRegistrationEmailAsync(registrationEmailDto);

            //Assert
            _mockSendRegistrationEmailProcess.Verify(x => x.SendRegistrationEmailAsync(registrationEmailDto), Times.Once);
        }
示例#3
0
        public async Task SendRegistrationEmailAsync(RegistrationEmailDto model)
        {
            var sendEmail = new SendEmailDto()
            {
                EmailAddress = model.EmailAddress,
                Data         = new List <SendEmailDto.DataItem>()
                {
                    new SendEmailDto.DataItem {
                        Value = model.CallBackUrl, Key = "ActivationUrl"
                    },
                },
                Name = model.EmailName
            };

            await _caseflowApiProxy.SendRegistrationEmailAsync(sendEmail, model.LowellReference, model.ReplayId);
        }
示例#4
0
        public void SendRegistrationEmailAsync_CreatesASendEmailDtoObjectAndSendsToCaseflow_ApiReturnsResultDto()
        {
            var dto = new RegistrationEmailDto()
            {
                CallBackUrl     = "https://www.lowell.co.uk",
                EmailAddress    = "*****@*****.**",
                LowellReference = "100262575"
            };

            var sendEmail = new SendEmailDto()
            {
                EmailAddress = "*****@*****.**",
                Data         = new List <SendEmailDto.DataItem>()
                {
                    new SendEmailDto.DataItem {
                        Value = "https://www.lowell.co.uk"
                    }
                }
            };

            _process.SendRegistrationEmailAsync(dto);
            _mockApi.Verify(x => x.SendRegistrationEmailAsync(sendEmail, It.IsAny <string>(), It.IsAny <string>()));
        }
示例#5
0
 public async Task SendRegistrationEmailAsync(RegistrationEmailDto model)
 {
     await _sendRegistrationEmailProcess.SendRegistrationEmailAsync(model);
 }