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()); }
public ActionResult Search(string grid) { var gridSearchesViewModel = new GridRunSearchesViewModel(); var gridRuns = _gridRunService.Search(grid, this._userService.GetUserManCoIds()); gridSearchesViewModel.AddGridRuns(gridRuns); return(View(gridSearchesViewModel)); }
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)); }