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
                ));
 }
Beispiel #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;
 }
 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 MethodologyImageService(ContentDbContext contentDbContext,
                                IPersistenceHelper <ContentDbContext> persistenceHelper,
                                IBlobStorageService blobStorageService,
                                IFileUploadsValidatorService fileUploadsValidatorService,
                                IFileRepository fileRepository,
                                IMethodologyFileRepository methodologyFileRepository,
                                IUserService userService)
 {
     _contentDbContext            = contentDbContext;
     _persistenceHelper           = persistenceHelper;
     _blobStorageService          = blobStorageService;
     _fileUploadsValidatorService = fileUploadsValidatorService;
     _fileRepository            = fileRepository;
     _methodologyFileRepository = methodologyFileRepository;
     _userService = userService;
 }
Beispiel #5
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
                       ));
        }