Esempio n. 1
0
        public ActionResult <BidDTO> GetBid(int id)
        {
            var bid = _bidService.GetBid(id);

            if (bid == null)
            {
                return(NotFound());
            }
            return(Ok(bid));
        }
Esempio n. 2
0
        public void GetBidTest_GetBidById_BidReturned()
        {
            //arrange
            int id = 4;

            _mockUnitOfWork.Setup(x => x.Bids.GetById(4)).Returns(_bids.Find(x => x.Id == id));

            //act
            var result = _service.GetBid(id);

            //assert
            Assert.That(result, Is.Not.Null);
            Assert.That(result.Id, Is.EqualTo(id));
        }