public void GetBidsTest_GetALLBids_AllBidsReturned() { //arrange _mockUnitOfWork.Setup(x => x.Bids.GetAll()).Returns(_bids); //act var result = _service.GetAllBids(); //assert Assert.That(result, Is.Not.Null); Assert.That(result.Count(), Is.EqualTo(_bids.Count())); }
// GET: Bid public ActionResult Index() { if (UserViewModel == null) { return(new HttpStatusCodeResult(401)); } if (!_customAuthentication.CheckUserInRoles(UserViewModel.ToUserEntity(), "Admin,Moderator")) { return(new HttpStatusCodeResult(403)); } var bids = _bidService.GetAllBids().Select(x => x.ToBidViewModel()); return(View(bids)); }
public ActionResult <IEnumerable <BidDTO> > GetAllBids() { var bids = _bidService.GetAllBids(); return(Ok(bids)); }