コード例 #1
0
        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);
        }
コード例 #2
0
 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));
     }
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 public IActionResult Get(int id)
 {
     return(Ok(_vendaService.Get(x => x.Id == id)));
 }