コード例 #1
0
        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);
        }
コード例 #2
0
        public async Task <IActionResult> ValidateUsername([FromBody] ValidateUsernameDto validateUsernameDto)
        {
            var isValidUsername = await authenticationProcessor.ValidateUsernameAsync(validateUsernameDto.Username);

            return(new OkObjectResult(new { valid = isValidUsername }));
        }