Esempio n. 1
0
        public void GivenValidData_WhenISearchForGridRunsByGrid_IGetGridRuns()
        {
            _gridRunRepository.Setup(g => g.Search(It.IsAny <string>())).Returns(new List <GridRun> {
                new GridRun(), new GridRun()
            });

            _gridRunService.Search(It.IsAny <string>());

            _gridRunRepository.Verify(g => g.Search(It.IsAny <string>()), Times.Once());
        }
Esempio n. 2
0
        public ActionResult Search(string grid)
        {
            var gridSearchesViewModel = new GridRunSearchesViewModel();
            var gridRuns = _gridRunService.Search(grid, this._userService.GetUserManCoIds());

            gridSearchesViewModel.AddGridRuns(gridRuns);
            return(View(gridSearchesViewModel));
        }
Esempio n. 3
0
        public ActionResult Grid(string term)
        {
            ////TODO Move this out of here
            var gridRuns = _gridRunService.Search(term, this._userService.GetUserManCoIds())
                           .Take(10)
                           .OrderBy(g => g.Grid)
                           .Select(r => new { label = r.Grid });

            return(Json(gridRuns, JsonRequestBehavior.AllowGet));
        }