Exemple #1
0
        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()));
        }
Exemple #2
0
        // 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));
        }
Exemple #3
0
        public ActionResult <IEnumerable <BidDTO> > GetAllBids()
        {
            var bids = _bidService.GetAllBids();

            return(Ok(bids));
        }