public void Test_CreateHistorialValidator(string descripcion, bool valid) { var command = new CreateHistorialCommand { Descripcion = descripcion }; var validator = new CreateHistorialValidator(); var result = validator.Validate(command); Assert.Equal(valid, result.IsValid); }
public async Task <ActionResult <DtoHistorial> > PostHistorialUsuario([FromBody] CreateHistorialCommand createHistorial) { var dtoHistorial = await Mediator.Send(createHistorial).ConfigureAwait(false); return(CreatedAtAction($"{nameof(HistorialController.GetHistorial)}", new { id = dtoHistorial.Id }, dtoHistorial)); }