Example #1
0
        public void HandlerFail()
        {
            var command = new PetCreateCommand();

            command.Name  = new ValueObjects.Name(firstName: "", lastName: "");
            command.Breed = "";

            var handle = new PetCreateHandler(new PetsRepositoryTest());
            var result = (CommandResult)handle.Handle(command);

            Assert.AreEqual(false, result.Ok);
        }
Example #2
0
 public CommandResult CreatePet([FromBody] PetCreateCommand command
                                , [FromServices] PetCreateHandler handler)
 {
     return((CommandResult)handler.Handle(command));
 }