public void GivenValidData_WhenTheFifteenMostRecentProcessedGridRunsAreRetrieved_AndTheDatabaseIsNotAvailabe_ThenAnUnityExceptionIsThrown() { this._gridRunRepository.Setup(x => x.GetTopFifteenSuccessfullyCompleted(It.IsAny <List <int> >())).Throws <Exception>(); Action act = () => _gridRunService.GetTopFifteenSuccessfullyCompleted(); act.ShouldThrow <UnityException>(); }
private void GetRecentlyProcessed(DashboardViewModel dashBoardViewModel) { IList <GridRun> recentlyProcessed; if (dashBoardViewModel.ManCosToFilter.Count > 0) { recentlyProcessed = _gridRunService.GetTopFifteenSuccessfullyCompleted(dashBoardViewModel.ManCosToFilter); } else { recentlyProcessed = _gridRunService.GetTopFifteenSuccessfullyCompleted(); } dashBoardViewModel.AddRecent(recentlyProcessed); }