private ReleaseDataFileService SetupReleaseDataFileService(
     ContentDbContext contentDbContext       = null,
     StatisticsDbContext statisticsDbContext = null,
     IPersistenceHelper <ContentDbContext> contentPersistenceHelper = null,
     IBlobStorageService blobStorageService = null,
     IDataArchiveValidationService dataArchiveValidationService = null,
     IFileUploadsValidatorService fileUploadsValidatorService   = null,
     IFileRepository fileRepository = null,
     IReleaseFileRepository releaseFileRepository = null,
     IImportService importService             = null,
     IImportStatusService importStatusService = null,
     IUserService userService = null)
 {
     return(new ReleaseDataFileService(
                contentDbContext ?? new Mock <ContentDbContext>().Object,
                statisticsDbContext ?? new Mock <StatisticsDbContext>().Object,
                contentPersistenceHelper ?? DefaultPersistenceHelperMock().Object,
                blobStorageService ?? new Mock <IBlobStorageService>().Object,
                dataArchiveValidationService ?? new Mock <IDataArchiveValidationService>().Object,
                fileUploadsValidatorService ?? new Mock <IFileUploadsValidatorService>().Object,
                fileRepository ?? new FileRepository(contentDbContext),
                releaseFileRepository ?? new ReleaseFileRepository(contentDbContext),
                importService ?? new Mock <IImportService>().Object,
                importStatusService ?? new Mock <IImportStatusService>().Object,
                userService ?? new Mock <IUserService>().Object
                ));
 }
Example #2
0
 public ReleaseDataFileService(
     ContentDbContext contentDbContext,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IBlobStorageService blobStorageService,
     IDataArchiveValidationService dataArchiveValidationService,
     IFileUploadsValidatorService fileUploadsValidatorService,
     IFileRepository fileRepository,
     IReleaseRepository releaseRepository,
     IReleaseFileRepository releaseFileRepository,
     IReleaseDataFileRepository releaseDataFileRepository,
     IDataImportService dataImportService,
     IUserService userService)
 {
     _contentDbContext             = contentDbContext;
     _persistenceHelper            = persistenceHelper;
     _blobStorageService           = blobStorageService;
     _dataArchiveValidationService = dataArchiveValidationService;
     _fileUploadsValidatorService  = fileUploadsValidatorService;
     _fileRepository            = fileRepository;
     _releaseRepository         = releaseRepository;
     _releaseFileRepository     = releaseFileRepository;
     _releaseDataFileRepository = releaseDataFileRepository;
     _dataImportService         = dataImportService;
     _userService = userService;
 }
Example #3
0
 public ReleaseService(
     ContentDbContext context,
     IMapper mapper,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IUserService userService,
     IReleaseRepository repository,
     IReleaseFileRepository releaseFileRepository,
     ISubjectRepository subjectRepository,
     IReleaseDataFileService releaseDataFileService,
     IReleaseFileService releaseFileService,
     IDataImportService dataImportService,
     IFootnoteService footnoteService,
     StatisticsDbContext statisticsDbContext,
     IDataBlockService dataBlockService,
     IReleaseSubjectRepository releaseSubjectRepository,
     IGuidGenerator guidGenerator,
     IBlobCacheService cacheService)
 {
     _context                  = context;
     _mapper                   = mapper;
     _persistenceHelper        = persistenceHelper;
     _userService              = userService;
     _repository               = repository;
     _releaseFileRepository    = releaseFileRepository;
     _subjectRepository        = subjectRepository;
     _releaseDataFileService   = releaseDataFileService;
     _releaseFileService       = releaseFileService;
     _dataImportService        = dataImportService;
     _footnoteService          = footnoteService;
     _statisticsDbContext      = statisticsDbContext;
     _dataBlockService         = dataBlockService;
     _releaseSubjectRepository = releaseSubjectRepository;
     _guidGenerator            = guidGenerator;
     _cacheService             = cacheService;
 }
Example #4
0
 public PermissionsController(IPersistenceHelper <ContentDbContext> persistenceHelper,
                              IReleaseFileRepository releaseFileRepository,
                              IUserService userService,
                              IPreReleaseService preReleaseService)
 {
     _persistenceHelper     = persistenceHelper;
     _releaseFileRepository = releaseFileRepository;
     _userService           = userService;
     _preReleaseService     = preReleaseService;
 }
Example #5
0
 public DataImportService(
     ContentDbContext contentDbContext,
     IDataImportRepository dataImportRepository,
     IReleaseFileRepository releaseFileRepository,
     IStorageQueueService queueService,
     IUserService userService)
 {
     _contentDbContext      = contentDbContext;
     _dataImportRepository  = dataImportRepository;
     _releaseFileRepository = releaseFileRepository;
     _queueService          = queueService;
     _userService           = userService;
 }
 private static DataImportService BuildDataImportService(
     ContentDbContext contentDbContext,
     IDataImportRepository dataImportRepository   = null,
     IReleaseFileRepository releaseFileRepository = null,
     IStorageQueueService queueService            = null,
     IUserService userService = null)
 {
     return(new DataImportService(
                contentDbContext,
                dataImportRepository ?? new DataImportRepository(contentDbContext),
                releaseFileRepository ?? new ReleaseFileRepository(contentDbContext),
                queueService ?? new Mock <IStorageQueueService>().Object,
                userService ?? MockUtils.AlwaysTrueUserService().Object));
 }
 public ReleaseImageService(ContentDbContext contentDbContext,
                            IPersistenceHelper <ContentDbContext> persistenceHelper,
                            IBlobStorageService blobStorageService,
                            IFileUploadsValidatorService fileUploadsValidatorService,
                            IReleaseFileRepository releaseFileRepository,
                            IUserService userService)
 {
     _contentDbContext            = contentDbContext;
     _persistenceHelper           = persistenceHelper;
     _blobStorageService          = blobStorageService;
     _fileUploadsValidatorService = fileUploadsValidatorService;
     _releaseFileRepository       = releaseFileRepository;
     _userService = userService;
 }
 public MigrateFilesService(ContentDbContext contentDbContext,
                            IBlobStorageService privateBlobStorageService,
                            IBlobStorageService publicBlobStorageService,
                            IReleaseFileRepository releaseFileRepository,
                            IUserService userService,
                            ILogger <MigrateFilesService> logger)
 {
     _contentDbContext          = contentDbContext;
     _privateBlobStorageService = privateBlobStorageService;
     _publicBlobStorageService  = publicBlobStorageService;
     _releaseFileRepository     = releaseFileRepository;
     _userService = userService;
     _logger      = logger;
 }
Example #9
0
 private ReleaseImageService SetupReleaseImageService(
     ContentDbContext contentDbContext = null,
     IPersistenceHelper <ContentDbContext> contentPersistenceHelper = null,
     IBlobStorageService blobStorageService = null,
     IFileUploadsValidatorService fileUploadsValidatorService = null,
     IReleaseFileRepository releaseFileRepository             = null,
     IUserService userService = null)
 {
     return(new ReleaseImageService(
                contentDbContext ?? Mock.Of <ContentDbContext>(),
                contentPersistenceHelper ?? DefaultPersistenceHelperMock().Object,
                blobStorageService ?? Mock.Of <IBlobStorageService>(),
                fileUploadsValidatorService ?? Mock.Of <IFileUploadsValidatorService>(),
                releaseFileRepository ?? Mock.Of <IReleaseFileRepository>(),
                userService ?? Mock.Of <IUserService>()
                ));
 }
        private ReleaseImageService SetupReleaseImageService(
            ContentDbContext contentDbContext,
            IPersistenceHelper <ContentDbContext> contentPersistenceHelper = null,
            IBlobStorageService blobStorageService = null,
            IFileUploadsValidatorService fileUploadsValidatorService = null,
            IReleaseFileRepository releaseFileRepository             = null,
            IUserService userService = null)
        {
            contentDbContext.Users.Add(_user);
            contentDbContext.SaveChanges();

            return(new ReleaseImageService(
                       contentDbContext,
                       contentPersistenceHelper ?? new PersistenceHelper <ContentDbContext>(contentDbContext),
                       blobStorageService ?? new Mock <IBlobStorageService>().Object,
                       fileUploadsValidatorService ?? new Mock <IFileUploadsValidatorService>().Object,
                       releaseFileRepository ?? new ReleaseFileRepository(contentDbContext),
                       userService ?? MockUtils.AlwaysTrueUserService(_user.Id).Object
                       ));
        }
 public ReleaseApprovalService(
     ContentDbContext context,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IUserService userService,
     IPublishingService publishingService,
     IReleaseChecklistService releaseChecklistService,
     IContentService contentService,
     IPreReleaseUserService preReleaseUserService,
     IReleaseFileRepository releaseFileRepository,
     IReleaseFileService releaseFileService,
     IReleaseRepository releaseRepository)
 {
     _context                 = context;
     _persistenceHelper       = persistenceHelper;
     _userService             = userService;
     _publishingService       = publishingService;
     _releaseChecklistService = releaseChecklistService;
     _contentService          = contentService;
     _preReleaseUserService   = preReleaseUserService;
     _releaseFileRepository   = releaseFileRepository;
     _releaseFileService      = releaseFileService;
     _releaseRepository       = releaseRepository;
 }