Exemple #1
0
        public GenericCommandResult MarkAsUndone(
            [FromBody] MarkTodoAsUndoneCommand command,
            [FromServices] MarkTodoAsUndoneHandler 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));
        }
Exemple #2
0
        public void Dado_um_comando_valido_marca_como_desfeito()
        {
            var result = (GenericCommandResult)_handler.Handle(_validCommand);

            Assert.True(result.Success);
        }