public void GivenValidData_WhenTopFifteenRecentExceptionsAreRetrieved_AndTheDatabaseIsNotAvailabe_ThenAnUnityExceptionIsThrown() { this._gridRunRepository.Setup(x => x.GetTopFifteenRecentExceptions(It.IsAny <List <int> >())).Throws <Exception>(); Action act = () => _gridRunService.GetTopFifteenRecentExceptions(); act.ShouldThrow <UnityException>(); }
private void GetRecentExceptions(DashboardViewModel dashBoardViewModel) { IList <GridRun> recentExceptions; if (dashBoardViewModel.ManCosToFilter.Count > 0) { recentExceptions = _gridRunService.GetTopFifteenRecentExceptions(dashBoardViewModel.ManCosToFilter); } else { recentExceptions = _gridRunService.GetTopFifteenRecentExceptions(); } dashBoardViewModel.AddExceptions(recentExceptions); }