public async Task Should_Return_Existing_Taxpayer_From_Repository() { var taxpayer = await _taxpayerService.GetByIdAsync(1); Assert.IsNotNull(taxpayer); Assert.AreEqual(1, taxpayer.Id); }
public async Task <IActionResult> GetByIdAsync(int id) { var taxpayer = await _taxpayerService.GetByIdAsync(id); if (taxpayer == null) { return(NotFound()); } var taxpayerResource = _mapper.Map <Taxpayer, TaxpayerResource>(taxpayer); return(Ok(taxpayerResource)); }