Example #1
0
        public async Task DeleteBidAsyncTest_DeleteExistingBid_BidDeleted()
        {
            var bidId = 3;

            _mockUnitWork.Setup(x => x.Bids.GetAsync(bidId)).ReturnsAsync(_bids.Find(x => x.BidId == bidId));
            _mockUnitWork.Setup(x => x.Bids.Delete(bidId));

            await _service.DeleteBidAsync(bidId);

            _mockUnitWork.Verify(x => x.Bids.Delete(bidId), Times.Once);
        }
        public async Task <IHttpActionResult> DeleteBidAsync(int id)
        {
            await _bidsService.DeleteBidAsync(id);

            return(ResponseMessage(new HttpResponseMessage(HttpStatusCode.NoContent)));
        }