예제 #1
0
        public void GivenValidData_WhenIAskForUnApprovedGrids_AndTheDataBaseIsNotAvailable_ThenAnUnityExceptionIsThrown()
        {
            _gridRunRepository.Setup(p => p.GetUnapproved(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <List <int> >())).Throws <Exception>();

            Action act = () => _gridRunService.GetUnapproved(It.IsAny <int>(), It.IsAny <int>());

            act.ShouldThrow <UnityException>();
        }
예제 #2
0
        public ActionResult Unapproved(int page = 1)
        {
            var manCoFilterViewModel = new ManCoFilterViewModel();
            var manCos            = new List <int>();
            var gridRunsViewModel = new GridRunsDetailViewModel();
            var gridRuns          = new PagedResult <GridRun>();

            if (Session["ManCoFilter"] != null)
            {
                manCoFilterViewModel = (ManCoFilterViewModel)Session["ManCoFilter"];
                manCos.Add(int.Parse(manCoFilterViewModel.SelectedManCoId));
                gridRuns = _gridRunService.GetUnapproved(page, _pageSize, manCos);

                gridRunsViewModel.AddGridRuns(gridRuns);
                return(View(gridRunsViewModel));
            }

            gridRuns = _gridRunService.GetUnapproved(page, _pageSize);
            gridRunsViewModel.AddGridRuns(gridRuns);
            return(View(gridRunsViewModel));
        }