public WeatherForecastController(
     ITableStorageService tableService,
     ILogger <WeatherForecastController> logger)
 {
     _logger           = logger;
     this.tableService = tableService;
 }
 public ImportStatusService(
     ITableStorageService tblStorageService,
     ILogger <ImportStatusService> logger)
 {
     _table  = tblStorageService.GetTableAsync(DatafileImportsTableName).Result;
     _logger = logger;
 }
 public CourseDirectoryImportFunctions(
     ICourseDirectoryDataService courseDirectoryDataService,
     ITableStorageService tableStorageService)
 {
     _courseDirectoryDataService = courseDirectoryDataService ?? throw new ArgumentNullException(nameof(courseDirectoryDataService));
     _tableStorageService        = tableStorageService ?? throw new ArgumentNullException(nameof(tableStorageService));
 }
Exemple #4
0
 public ReleaseStatusService(ContentDbContext context,
                             ILogger <ReleaseStatusService> logger,
                             ITableStorageService tableStorageService)
 {
     _context             = context;
     _logger              = logger;
     _tableStorageService = tableStorageService;
 }
Exemple #5
0
 public FastTrackService(ContentDbContext contentDbContext,
                         IBlobStorageService publicBlobStorageService,
                         ITableStorageService tableStorageService)
 {
     _contentDbContext         = contentDbContext;
     _publicBlobStorageService = publicBlobStorageService;
     _tableStorageService      = tableStorageService;
 }
 private static ImportStatusService BuildImportStatusService(
     ITableStorageService tableStorageService = null)
 {
     return(new ImportStatusService(
                tableStorageService ?? new Mock <ITableStorageService>().Object,
                new Mock <ILogger <ImportStatusService> >().Object
                ));
 }
 public ProviderDataMigrationService(
     IFileReader fileReader,
     ITableStorageService tableStorageService,
     ILogger <ProviderDataMigrationService> logger)
 {
     _fileReader          = fileReader ?? throw new ArgumentNullException(nameof(fileReader));
     _tableStorageService = tableStorageService ?? throw new ArgumentNullException(nameof(tableStorageService));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemple #8
0
 public CourseDirectoryDataService(
     IHttpClientFactory httpClientFactory,
     ITableStorageService tableStorageService,
     ILogger <CourseDirectoryDataService> logger)
 {
     _httpClientFactory   = httpClientFactory ?? throw new ArgumentNullException(nameof(httpClientFactory));
     _tableStorageService = tableStorageService ?? throw new ArgumentNullException(nameof(tableStorageService));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
        public static CourseDirectoryImportFunctions BuildCourseDirectoryImportFunctions(
            ICourseDirectoryDataService courseDirectoryDataService = null,
            ITableStorageService tableStorageService = null)
        {
            courseDirectoryDataService ??= Substitute.For <ICourseDirectoryDataService>();
            tableStorageService ??= Substitute.For <ITableStorageService>();

            return(new CourseDirectoryImportFunctions(courseDirectoryDataService, tableStorageService));
        }
 public ProviderDataService(
     ITableStorageService tableStorageService,
     IMemoryCache cache,
     ConfigurationOptions configuration)
 {
     _tableStorageService = tableStorageService ?? throw new ArgumentNullException(nameof(tableStorageService));
     _cache = cache ?? throw new ArgumentNullException(nameof(cache));
     _cacheExpiryInSeconds  = configuration?.CacheExpiryInSeconds ?? 60;
     _mergeTempProviderData = configuration?.MergeTempProviderData ?? false;
 }
 public ValuesController(IHostingEnvironment hostingEnvironment,
                         IBlobStorageService blobStorageService,
                         ICosmosDbService cosmosDbService,
                         ITableStorageService tableStorageService)
 {
     _hostingEnvironment  = hostingEnvironment;
     _blobStorageService  = blobStorageService;
     _cosmosDbService     = cosmosDbService;
     _tableStorageService = tableStorageService;
 }
 public ImportStatusBauService(ITableStorageService tableStorageService,
                               IUserService userService,
                               ContentDbContext contentDbContext,
                               ILogger <ImportStatusBauService> logger)
 {
     _tableStorageService = tableStorageService;
     _userService         = userService;
     _contentDbContext    = contentDbContext;
     _logger = logger;
 }
Exemple #13
0
 public PublicationMetaService(IReleaseService releaseService,
                               ISubjectService subjectService,
                               ITableStorageService tableStorageService,
                               IMapper mapper)
 {
     _releaseService      = releaseService;
     _subjectService      = subjectService;
     _tableStorageService = tableStorageService;
     _mapper = mapper;
 }
 public ProviderDataService(
     ITableStorageService tableStorageService,
     IMemoryCache cache,
     ILogger <ProviderDataService> logger,
     ConfigurationOptions configuration)
 {
     _tableStorageService = tableStorageService ?? throw new ArgumentNullException(nameof(tableStorageService));
     _cache  = cache ?? throw new ArgumentNullException(nameof(cache));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _cacheExpiryInSeconds = configuration?.CacheExpiryInSeconds ?? 60;
 }
    private static CourseDirectoryDataService BuildCourseDirectoryDataService(
        IHttpClientFactory httpClientFactory        = null,
        ITableStorageService tableStorageService    = null,
        ILogger <CourseDirectoryDataService> logger = null)
    {
        httpClientFactory ??= Substitute.For <IHttpClientFactory>();
        tableStorageService ??= Substitute.For <ITableStorageService>();
        logger ??= Substitute.For <ILogger <CourseDirectoryDataService> >();

        return(new CourseDirectoryDataService(httpClientFactory, tableStorageService, logger));
    }
Exemple #16
0
 public ReleaseStatusService(
     IMapper mapper,
     IUserService userService,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     ITableStorageService publisherTableStorageService)
 {
     _mapper                       = mapper;
     _userService                  = userService;
     _persistenceHelper            = persistenceHelper;
     _publisherTableStorageService = publisherTableStorageService;
 }
 public FastTrackService(
     ITableBuilderService tableBuilderService,
     IBlobStorageService blobStorageService,
     ITableStorageService tableStorageService,
     IReleaseRepository releaseRepository,
     IMapper mapper)
 {
     _tableBuilderService = tableBuilderService;
     _blobStorageService  = blobStorageService;
     _tableStorageService = tableStorageService;
     _releaseRepository   = releaseRepository;
     _mapper = mapper;
 }
 public FastTrackService(
     ITableBuilderService tableBuilderService,
     IBlobStorageService blobStorageService,
     ISubjectService subjectService,
     ITableStorageService tableStorageService,
     IMapper mapper)
 {
     _tableBuilderService = tableBuilderService;
     _blobStorageService  = blobStorageService;
     _subjectService      = subjectService;
     _tableStorageService = tableStorageService;
     _mapper = mapper;
 }
 private ReleasePublishingStatusService BuildReleaseStatusService(
     IMapper mapper           = null,
     IUserService userService = null,
     IPersistenceHelper <ContentDbContext> persistenceHelper = null,
     ITableStorageService publisherTableStorageService       = null)
 {
     return(new ReleasePublishingStatusService(
                mapper ?? MapperUtils.AdminMapper(),
                userService ?? new Mock <IUserService>().Object,
                persistenceHelper ?? MockUtils.MockPersistenceHelper <ContentDbContext, Release>(_release.Id, _release)
                .Object,
                publisherTableStorageService ?? new Mock <ITableStorageService>().Object
                ));
 }
    private static IProviderDataService CreateProviderDataService(
        ITableStorageService tableStorageService = null,
        IMemoryCache cache = null,
        ConfigurationOptions configuration = null)
    {
        tableStorageService ??= Substitute.For <ITableStorageService>();
        cache ??= Substitute.For <IMemoryCache>();
        configuration ??= new ConfigurationOptions
        {
            CacheExpiryInSeconds = 1
        };

        return(new ProviderDataService(tableStorageService, cache, configuration));
    }
 public ImportService(ContentDbContext contentDbContext,
                      IMapper mapper,
                      ILogger <ImportService> logger,
                      IStorageQueueService queueService,
                      ITableStorageService tableStorageService,
                      IGuidGenerator guidGenerator,
                      IUserService userService)
 {
     _context             = contentDbContext;
     _mapper              = mapper;
     _logger              = logger;
     _queueService        = queueService;
     _tableStorageService = tableStorageService;
     _guidGenerator       = guidGenerator;
     _userService         = userService;
 }
Exemple #22
0
 public ReleaseChecklistService(
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     ITableStorageService tableStorageService,
     IUserService userService,
     IMetaGuidanceService metaGuidanceService,
     IFileRepository fileRepository,
     IFootnoteRepository footnoteRepository,
     IDataBlockService dataBlockService)
 {
     _persistenceHelper   = persistenceHelper;
     _tableStorageService = tableStorageService;
     _userService         = userService;
     _metaGuidanceService = metaGuidanceService;
     _fileRepository      = fileRepository;
     _footnoteRepository  = footnoteRepository;
     _dataBlockService    = dataBlockService;
 }
        public TemperatureMonitorViewModel(
            IRestApiService restApiService,
            ITemperatureSensorService temperatureSensorService,
            ITableStorageService tableStorageService)
        {
            _restApiService           = restApiService;
            _temperatureSensorService = temperatureSensorService;
            _tableStorageService      = tableStorageService;

            _cancellationTokenSource = new CancellationTokenSource();

            IsLoading = true;
            Summary   = new ObservableCollection <SensorData>();
            Date      = DateTime.Now;

            RefreshCommand      = new Command(async() => await RefreshAsync());
            NextDateCommand     = new Command(async() => await NextDateAsync());
            PreviousDateCommand = new Command(async() => await PreviousDateAsync());
        }
Exemple #24
0
 private ReleaseChecklistService BuildReleaseChecklistService(
     ContentDbContext contentDbContext,
     ITableStorageService tableStorageService = null,
     IUserService userService = null,
     IMetaGuidanceService metaGuidanceService = null,
     IFileRepository fileRepository           = null,
     IFootnoteRepository footnoteRepository   = null,
     IDataBlockService dataBlockService       = null)
 {
     return(new ReleaseChecklistService(
                new PersistenceHelper <ContentDbContext>(contentDbContext),
                tableStorageService ?? MockTableStorageService(new List <DatafileImport>()).Object,
                userService ?? MockUtils.AlwaysTrueUserService().Object,
                metaGuidanceService ?? new Mock <IMetaGuidanceService>().Object,
                fileRepository ?? new Mock <IFileRepository>().Object,
                footnoteRepository ?? new Mock <IFootnoteRepository>().Object,
                dataBlockService ?? new Mock <IDataBlockService>().Object
                ));
 }
Exemple #25
0
 private ReleaseChecklistService BuildReleaseChecklistService(
     IPersistenceHelper <ContentDbContext> persistenceHelper = null,
     ITableStorageService tableStorageService = null,
     IUserService userService = null,
     IMetaGuidanceService metaGuidanceService = null,
     IFileRepository fileRepository           = null,
     IFootnoteRepository footnoteRepository   = null,
     IDataBlockService dataBlockService       = null)
 {
     return(new ReleaseChecklistService(
                persistenceHelper ?? DefaultPersistenceHelperMock().Object,
                tableStorageService ?? new Mock <ITableStorageService>().Object,
                userService ?? MockUtils.AlwaysTrueUserService().Object,
                metaGuidanceService ?? new Mock <IMetaGuidanceService>().Object,
                fileRepository ?? new Mock <IFileRepository>().Object,
                footnoteRepository ?? new Mock <IFootnoteRepository>().Object,
                dataBlockService ?? new Mock <IDataBlockService>().Object
                ));
 }
Exemple #26
0
        public static async Task Initialize(TestContext _)
        {
            // Set the correct keyvault name
            configService = new E2ETestConfigService("<enter keyvault name>");
            await configService.LoadConfigurationAsync().ConfigureAwait(false);

            var storageAccount = CloudStorageAccount.Parse(configService.TableStorageAccountConnectionString);

            // Create a table client for interacting with the table service
            var tableClient = storageAccount.CreateCloudTableClient();

            // Create a table client for interacting with the table service
            var mediaServiceInstanceHealthTable = tableClient.GetTableReference(configService.MediaServiceInstanceHealthTableName);
            await mediaServiceInstanceHealthTable.CreateIfNotExistsAsync().ConfigureAwait(false);

            mediaServiceInstanceHealthTableStorageService = new TableStorageService(mediaServiceInstanceHealthTable);
            await mediaServiceInstanceHealthTableStorageService.DeleteAllAsync <MediaServiceInstanceHealthModelTableEntity>().ConfigureAwait(false);

            var jobOutputStatusTable = tableClient.GetTableReference(configService.JobOutputStatusTableName);
            await jobOutputStatusTable.CreateIfNotExistsAsync().ConfigureAwait(false);

            jobOutputStatusTableStorageService = new TableStorageService(jobOutputStatusTable);
            await jobOutputStatusTableStorageService.DeleteAllAsync <JobOutputStatusModelTableEntity>().ConfigureAwait(false);

            var mediaServiceCallHistoryTable = tableClient.GetTableReference(configService.MediaServiceCallHistoryTableName);

            mediaServiceCallHistoryTable.CreateIfNotExists();
            var mediaServiceCallHistoryTableStorageService = new TableStorageService(mediaServiceCallHistoryTable);

            mediaServiceCallHistoryStorageService = new MediaServiceCallHistoryStorageService(mediaServiceCallHistoryTableStorageService);
            await mediaServiceCallHistoryTableStorageService.DeleteAllAsync <MediaServiceCallHistoryModelTableEntity>().ConfigureAwait(false);

            jobRequestQueue = new QueueClient(configService.StorageAccountConnectionString, configService.JobRequestQueueName);
            await jobRequestQueue.CreateIfNotExistsAsync().ConfigureAwait(false);

            jobVerificationRequestQueue = new QueueClient(configService.StorageAccountConnectionString, configService.JobVerificationRequestQueueName);
            await jobVerificationRequestQueue.CreateIfNotExistsAsync().ConfigureAwait(false);
        }
 private ReleaseService BuildReleaseService(
     ContentDbContext context             = null,
     IMapper mapper                       = null,
     IPublishingService publishingService = null,
     IPersistenceHelper <ContentDbContext> persistenceHelper = null,
     IUserService userService                         = null,
     IReleaseRepository releaseRepository             = null,
     ISubjectService subjectService                   = null,
     ITableStorageService tableStorageService         = null,
     IReleaseFileService releaseFileService           = null,
     IReleaseDataFileService releaseDataFileService   = null,
     IImportStatusService importStatusService         = null,
     IFootnoteService footnoteService                 = null,
     StatisticsDbContext statisticsDbContext          = null,
     IDataBlockService dataBlockService               = null,
     IReleaseChecklistService releaseChecklistService = null,
     IReleaseSubjectService releaseSubjectService     = null)
 {
     return(new ReleaseService(
                context ?? new Mock <ContentDbContext>().Object,
                mapper ?? AdminMapper(),
                publishingService ?? new Mock <IPublishingService>().Object,
                persistenceHelper ?? DefaultPersistenceHelperMock().Object,
                userService ?? new Mock <IUserService>().Object,
                releaseRepository ?? new Mock <IReleaseRepository>().Object,
                subjectService ?? new Mock <ISubjectService>().Object,
                tableStorageService ?? new Mock <ITableStorageService>().Object,
                releaseDataFileService ?? new Mock <IReleaseDataFileService>().Object,
                releaseFileService ?? new Mock <IReleaseFileService>().Object,
                importStatusService ?? new Mock <IImportStatusService>().Object,
                footnoteService ?? new Mock <IFootnoteService>().Object,
                statisticsDbContext ?? new Mock <StatisticsDbContext>().Object,
                dataBlockService ?? new Mock <IDataBlockService>().Object,
                releaseChecklistService ?? new Mock <IReleaseChecklistService>().Object,
                releaseSubjectService ?? new Mock <IReleaseSubjectService>().Object,
                new SequentialGuidGenerator()
                ));
 }
Exemple #28
0
 // TODO EES-212 - ReleaseService needs breaking into smaller services as it feels like it is now doing too
 // much work and has too many dependencies
 public ReleaseService(
     ContentDbContext context,
     IMapper mapper,
     IPublishingService publishingService,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IUserService userService,
     IReleaseRepository repository,
     ISubjectService subjectService,
     ITableStorageService coreTableStorageService,
     IReleaseDataFileService releaseDataFileService,
     IReleaseFileService releaseFileService,
     IImportStatusService importStatusService,
     IFootnoteService footnoteService,
     StatisticsDbContext statisticsDbContext,
     IDataBlockService dataBlockService,
     IReleaseChecklistService releaseChecklistService,
     IReleaseSubjectService releaseSubjectService,
     IGuidGenerator guidGenerator)
 {
     _context                 = context;
     _publishingService       = publishingService;
     _mapper                  = mapper;
     _persistenceHelper       = persistenceHelper;
     _userService             = userService;
     _repository              = repository;
     _subjectService          = subjectService;
     _coreTableStorageService = coreTableStorageService;
     _releaseDataFileService  = releaseDataFileService;
     _releaseFileService      = releaseFileService;
     _importStatusService     = importStatusService;
     _footnoteService         = footnoteService;
     _statisticsDbContext     = statisticsDbContext;
     _dataBlockService        = dataBlockService;
     _releaseChecklistService = releaseChecklistService;
     _releaseSubjectService   = releaseSubjectService;
     _guidGenerator           = guidGenerator;
 }
 public WalletUserRepository(ITableStorageService tableStorageService)
 {
     _tableStorageService = tableStorageService ?? throw new ArgumentNullException(nameof(tableStorageService));
 }
 public LocationController(IConfigurationService configuration, ITableStorageService tableStorage) :
     base(configuration, tableStorage)
 {
 }