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); }
public CommandResult CreatePet([FromBody] PetCreateCommand command , [FromServices] PetCreateHandler handler) { return((CommandResult)handler.Handle(command)); }