public void GivenValidData_WhenTryingToRetreiveGridRunsByHHGrid_WithManCoFilter_AndTheDatabaseIsNotAvailabe_ThenAnUnityExceptionIsThrown()
        {
            _gridRunRepository.Setup(x => x.GetGridRuns(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>(), It.IsAny <List <int> >())).Throws <Exception>();
            Action act = () => _gridRunService.GetGridRuns(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>(), It.IsAny <List <int> >());

            act.ShouldThrow <UnityException>();
        }
Beispiel #2
0
        public ActionResult HouseHolding(string houseHoldingGrid, 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.GetGridRuns(page, _pageSize, houseHoldingGrid, manCos);

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

            gridRuns = _gridRunService.GetGridRuns(page, _pageSize, houseHoldingGrid);
            gridRunsViewModel.AddGridRuns(gridRuns, true);
            return(View(gridRunsViewModel));
        }