public AlertReportServiceTests() { _nyssContext = Substitute.For <INyssContext>(); var config = Substitute.For <INyssWebConfig>(); _alertService = Substitute.For <IAlertService>(); _queueService = Substitute.For <IQueueService>(); _dateTimeProvider = Substitute.For <IDateTimeProvider>(); _authorizationService = Substitute.For <IAuthorizationService>(); _alertReportService = new AlertReportService(config, _nyssContext, _alertService, _queueService, _dateTimeProvider, _authorizationService); _alertReports = TestData.GetAlertReports(); var alertReportsDbSet = _alertReports.AsQueryable().BuildMockDbSet(); _nyssContext.AlertReports.Returns(alertReportsDbSet); config.ServiceBusQueues.Returns(new ServiceBusQueuesOptions { ReportDismissalQueue = TestData.ReportDismissalQueue }); _dateTimeProvider.UtcNow.Returns(_now); _authorizationService.GetCurrentUser().Returns(_currentUser); }
private void SaveAlertReport() { AlertReportService alertReportService = new AlertReportService(); alertReportService.Add<EOfflineTimeoutAlertReport>(_alertReport); }
private void SaveAlertReport() { AlertReportService alertReportService = new AlertReportService(); alertReportService.Add<EFatigueDrivingReport>(_alertReport); }
private void UpdateAlertReport() { _alertReport.AlertState = (int)EnumAlertState.Resume; AlertReportService alertReportService = new AlertReportService(); alertReportService.Update<EOfflineTimeoutAlertReport>(_alertReport); }
private void UpdateAlertReport() { _alertReport.AlertState = (int)EnumAlertState.Resume; AlertReportService alertReportService = new AlertReportService(); alertReportService.Update<EFatigueDrivingReport>(_alertReport); }