Пример #1
0
        public ReportServiceTests()
        {
            _nyssContextMock = Substitute.For <INyssContext>();

            _config = Substitute.For <INyssWebConfig>();
            _config.PaginationRowsPerPage.Returns(_rowsPerPage);

            _userService = Substitute.For <IUserService>();
            _userService.GetUserApplicationLanguageCode(Arg.Any <string>()).Returns(Task.FromResult("en"));

            _projectService = Substitute.For <IProjectService>();
            _projectService.GetHealthRiskNames(Arg.Any <int>(), Arg.Any <List <HealthRiskType> >()).Returns(Task.FromResult(Enumerable.Empty <HealthRiskDto>()));

            _authorizationService = Substitute.For <IAuthorizationService>();
            _authorizationService.GetCurrentUserName().Returns((string)null);

            _excelExportService      = Substitute.For <IExcelExportService>();
            _stringsResourcesService = Substitute.For <IStringsResourcesService>();

            _dateTimeProvider = Substitute.For <IDateTimeProvider>();

            _reportService = new ReportService(_nyssContextMock, _userService, _projectService, _config, _authorizationService, _excelExportService, _stringsResourcesService, _dateTimeProvider);

            _authorizationService.IsCurrentUserInRole(Role.Supervisor).Returns(false);
            _authorizationService.GetCurrentUserName().Returns("*****@*****.**");
            ArrangeData();
        }
Пример #2
0
        public StringsResourcesServiceTests()
        {
            var logger = Substitute.For <ILoggerAdapter>();

            _nyssBlobProvider = Substitute.For <INyssBlobProvider>();

            _stringsResourcesService = new StringsResourcesService(_nyssBlobProvider, logger);
        }
Пример #3
0
 public AppDataController(
     IAppDataService appDataService,
     IStringsResourcesService stringsResourcesService,
     IInMemoryCache inMemoryCache)
 {
     _appDataService          = appDataService;
     _stringsResourcesService = stringsResourcesService;
     _inMemoryCache           = inMemoryCache;
 }
Пример #4
0
 public ResourcesService(
     IStringsResourcesService stringsResourcesService,
     INyssContext nyssContext,
     INyssWebConfig config)
 {
     _stringsResourcesService = stringsResourcesService;
     _nyssContext             = nyssContext;
     _config = config;
 }
Пример #5
0
 public AlertService(INyssContext nyssContext, IReportLabelingService reportLabelingService, ILoggerAdapter loggerAdapter, IQueuePublisherService queuePublisherService,
                     INyssReportApiConfig config, IStringsResourcesService stringsResourcesService, IDateTimeProvider dateTimeProvider)
 {
     _nyssContext           = nyssContext;
     _reportLabelingService = reportLabelingService;
     _loggerAdapter         = loggerAdapter;
     _queuePublisherService = queuePublisherService;
     _config = config;
     _stringsResourcesService = stringsResourcesService;
     _dateTimeProvider        = dateTimeProvider;
 }
Пример #6
0
 public DataCollectorExportService(
     INyssContext nyssContext,
     IExcelExportService excelExportService,
     IStringsResourcesService stringsResourcesService,
     IAuthorizationService authorizationService)
 {
     _nyssContext             = nyssContext;
     _excelExportService      = excelExportService;
     _stringsResourcesService = stringsResourcesService;
     _authorizationService    = authorizationService;
 }
Пример #7
0
 public ReportService(INyssContext nyssContext, IUserService userService, IProjectService projectService, INyssWebConfig config, IAuthorizationService authorizationService,
                      IExcelExportService excelExportService, IStringsResourcesService stringsResourcesService, IDateTimeProvider dateTimeProvider)
 {
     _nyssContext             = nyssContext;
     _userService             = userService;
     _projectService          = projectService;
     _config                  = config;
     _authorizationService    = authorizationService;
     _excelExportService      = excelExportService;
     _stringsResourcesService = stringsResourcesService;
     _dateTimeProvider        = dateTimeProvider;
 }
Пример #8
0
 public SmsEagleHandler(
     IReportMessageService reportMessageService,
     INyssContext nyssContext,
     ILoggerAdapter loggerAdapter,
     IDateTimeProvider dateTimeProvider,
     IStringsResourcesService stringsResourcesService,
     IQueuePublisherService queuePublisherService,
     IAlertService alertService)
 {
     _reportMessageService    = reportMessageService;
     _nyssContext             = nyssContext;
     _loggerAdapter           = loggerAdapter;
     _dateTimeProvider        = dateTimeProvider;
     _queuePublisherService   = queuePublisherService;
     _alertService            = alertService;
     _stringsResourcesService = stringsResourcesService;
 }
Пример #9
0
        public AlertServiceTests()
        {
            var reportLabelingServiceMock = Substitute.For <IReportLabelingService>();

            _queuePublisherServiceMock   = Substitute.For <IQueuePublisherService>();
            _nyssReportApiConfigMock     = Substitute.For <INyssReportApiConfig>();
            _nyssContextMock             = Substitute.For <INyssContext>();
            _loggerAdapterMock           = Substitute.For <ILoggerAdapter>();
            _stringsResourcesServiceMock = Substitute.For <IStringsResourcesService>();
            _dateTimeProviderMock        = Substitute.For <IDateTimeProvider>();
            _alertService = new AlertService(
                _nyssContextMock,
                reportLabelingServiceMock,
                _loggerAdapterMock,
                _queuePublisherServiceMock,
                _nyssReportApiConfigMock,
                _stringsResourcesServiceMock,
                _dateTimeProviderMock
                );

            _testData = new AlertServiceTestData(_nyssContextMock);
        }
Пример #10
0
 public SmsTextGeneratorService(IStringsResourcesService stringsResourcesService)
 {
     _stringsResourcesService = stringsResourcesService;
 }