Ejemplo n.º 1
0
        public void MediaRequestsShouldReturnMediaRequestsView()
        {
            Expect.Call(membershipService.IsAdmin(fakeAdmin.Identity.Name)).Return(true);
            Expect.Call(insertRequestService.GetAllOrderedByRequestDate()).Return(insertRequests);
            mocks.ReplayAll();

            AdminController adminController = new AdminController(membershipService, insertRequestService, mediaService);

            ViewResult result = adminController.MediaRequests(fakeAdmin) as ViewResult;

            Assert.IsNotNull(result);
            Assert.AreEqual(mediaRequests_ViewName, result.ViewName);
        }
Ejemplo n.º 2
0
        public ActionResult MediaRequests(IPrincipal admin, int page = 0)
        {
            if (!membershipService.IsAdmin(admin.Identity.Name))
            {
                return(View("NotAuthorized"));
            }

            IQueryable <InsertRequest>    insertRequests          = insertRequestService.GetAllOrderedByRequestDate();
            PaginatedList <InsertRequest> paginatedInsertRequests = new PaginatedList <InsertRequest>(insertRequests, page, pageSize);

            return(View("MediaRequests", paginatedInsertRequests));
        }