public async void ShouldFetchLoginCredsFromRepo() { loginRepo.Setup(l => l.GetLoginCredsByUserNameAsync(It.IsAny <string>())) .ReturnsAsync(loginCredentials); var result = await processor.ValidateUsernameAsync(It.IsAny <string>()); loginRepo.Verify(l => l.GetLoginCredsByUserNameAsync(It.IsAny <string>()), Times.Once); }
public async Task <IActionResult> ValidateUsername([FromBody] ValidateUsernameDto validateUsernameDto) { var isValidUsername = await authenticationProcessor.ValidateUsernameAsync(validateUsernameDto.Username); return(new OkObjectResult(new { valid = isValidUsername })); }