public async Task <IActionResult> Cadastrar([FromBody] UsuarioParam user) { try { await _usuarioCommand.Criar(user); return(Ok("Usuário cadastrado com sucesso!")); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, e.Message)); } }
public async Task QuandoInseridoOUsuario() { var login = _scenarioContext.Get <string>("FirstNumber"); var senha = _scenarioContext.Get <string>("SecondNumber"); var usuario = new AutoFaker <UsuarioParam>() .RuleFor(fake => fake.Login, fake => login) .RuleFor(fake => fake.Senha, fake => senha) .RuleFor(fake => fake.Role, fake => RoleEnum.Administrador.ToString()) .Generate(); var result = await _usuarioCommand.Criar(usuario); _scenarioContext.Add("FinalResult", result); }