public async Task <IActionResult> SendRegistrationEmail([FromBody] RegistrationEmailDto model) { if (!ModelState.IsValid) { Forbid(); } await _registerService.SendRegistrationEmailAsync(model); return(Ok()); }
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); }
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); }
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>())); }
public async Task SendRegistrationEmailAsync(RegistrationEmailDto model) { await _sendRegistrationEmailProcess.SendRegistrationEmailAsync(model); }