public async Task <IHttpActionResult> GetBidAsync(int id) { var bid = await _bidsService.GetBidAsync(id); if (bid == null) { return(NotFound()); } return(Ok(bid)); }
public async Task GetBidAsyncTest_GetBidById_BidReturned() { var bidId = 5; _mockUnitWork.Setup(x => x.Bids.GetAsync(5)).ReturnsAsync(_bids.Find(x => x.BidId == bidId)); var result = await _service.GetBidAsync(bidId); Assert.That(result, Is.Not.Null); Assert.That(result.BidId, Is.EqualTo(bidId)); }