public void Integration_AddSale_ShouldBeOK() { Venda venda = ObjectMotherSale.GetVenda(); Venda vendaReceived = _service.Add(venda); var vendaVerify = _service.Get(venda.Id); vendaVerify.Should().NotBeNull(); vendaVerify.Id.Should().Be(1); }
public async Task <ActionResult> Get([FromHeader] Guid id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { return(Ok(await _service.Get(id))); } catch (ArgumentException ex) { return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message)); } }
public void VendaService_Get_ShouldBeOk() { _venda = ObjectMotherSale.GetVenda(); _vendaRepository.Setup(x => x.Get(1)).Returns(_venda); _venda = _vendaService.Get(1); _vendaRepository.Verify(x => x.Get(1)); _venda.Should().NotBeNull(); }
public IActionResult Get(int id) { return(Ok(_vendaService.Get(x => x.Id == id))); }