Esempio n. 1
0
        public GenericCommandResult MarkAsDone(
            [FromBody] MarkTodoAsDoneCommand command,
            [FromServices] MarkTodoAsDoneHandler handler,
            Guid id
            )
        {
            if (id != command.Id)
            {
                return(new GenericCommandResult(false, "Id não encontrado", false));
            }

            var user = User.Claims.FirstOrDefault(x => x.Type == "user_id")?.Value;

            command.User = user;
            return((GenericCommandResult)handler.Handle(command));
        }
Esempio n. 2
0
        public void Dado_um_comando_valido_marca_como_feito()
        {
            var result = (GenericCommandResult)_handler.Handle(_validCommand);

            Assert.True(result.Success);
        }