public void Create_EmptyPdvRequest_ThrowsValidationException() { var request = new PdvRequest(); TestDelegate testDelegate = new TestDelegate(() => _service.Create(request)); Assert.Throws <ValidationException>(testDelegate); }
public PdvResponse Create(PdvRequest request) { _validator.ValidateAndThrow(request); //TODO: Implementar handler validação Pdv pdv = _repository.Insert(new Pdv(request)); return(new PdvResponse(pdv)); }
public ActionResult Post(PdvRequest request) { var pdv = _service.Create(request); return(CreatedAtAction(nameof(Get), new { id = pdv.Id }, pdv)); }