예제 #1
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;
 }
예제 #2
0
 private TopicService SetupTopicService(
     ContentDbContext contentContext       = null,
     StatisticsDbContext statisticsContext = null,
     PersistenceHelper <ContentDbContext> persistenceHelper = null,
     IMapper mapper           = null,
     IUserService userService = null,
     IReleaseSubjectRepository releaseSubjectRepository = null,
     IReleaseDataFileService releaseDataFileService     = null,
     IReleaseFileService releaseFileService             = null,
     IPublishingService publishingService   = null,
     IMethodologyService methodologyService = null)
 {
     return(new TopicService(
                Mock.Of <IConfiguration>(),
                contentContext ?? Mock.Of <ContentDbContext>(),
                statisticsContext ?? Mock.Of <StatisticsDbContext>(),
                persistenceHelper ?? MockUtils.MockPersistenceHelper <ContentDbContext, Topic>(_topic.Id, _topic).Object,
                mapper ?? AdminMapper(),
                userService ?? MockUtils.AlwaysTrueUserService().Object,
                releaseSubjectRepository ?? Mock.Of <IReleaseSubjectRepository>(),
                releaseDataFileService ?? Mock.Of <IReleaseDataFileService>(),
                releaseFileService ?? Mock.Of <IReleaseFileService>(),
                publishingService ?? Mock.Of <IPublishingService>(),
                methodologyService ?? Mock.Of <IMethodologyService>(),
                Mock.Of <IBlobCacheService>()
                ));
 }
예제 #3
0
 public TopicService(
     IConfiguration configuration,
     ContentDbContext contentContext,
     StatisticsDbContext statisticsContext,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IMapper mapper,
     IUserService userService,
     IReleaseSubjectRepository releaseSubjectRepository,
     IReleaseDataFileService releaseDataFileService,
     IReleaseFileService releaseFileService,
     IPublishingService publishingService,
     IMethodologyService methodologyService,
     IBlobCacheService cacheService)
 {
     _contentContext           = contentContext;
     _statisticsContext        = statisticsContext;
     _persistenceHelper        = persistenceHelper;
     _mapper                   = mapper;
     _userService              = userService;
     _releaseSubjectRepository = releaseSubjectRepository;
     _releaseDataFileService   = releaseDataFileService;
     _releaseFileService       = releaseFileService;
     _publishingService        = publishingService;
     _methodologyService       = methodologyService;
     _cacheService             = cacheService;
     _topicDeletionAllowed     = configuration.GetValue <bool>("enableThemeDeletion");
 }
예제 #4
0
 public ReleaseFileController(
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IDataBlockService dataBlockService,
     IReleaseFileService releaseFileService)
 {
     _persistenceHelper  = persistenceHelper;
     _dataBlockService   = dataBlockService;
     _releaseFileService = releaseFileService;
 }
 public DataBlockService(
     ContentDbContext context,
     IMapper mapper, IPersistenceHelper <ContentDbContext> persistenceHelper,
     IUserService userService,
     IReleaseFileService releaseFileService)
 {
     _context            = context;
     _mapper             = mapper;
     _persistenceHelper  = persistenceHelper;
     _userService        = userService;
     _releaseFileService = releaseFileService;
 }
예제 #6
0
 public ManageContentPageService(
     IMapper mapper,
     IReleaseFileService releaseFileService,
     IContentService contentService,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IUserService userService)
 {
     _mapper             = mapper;
     _releaseFileService = releaseFileService;
     _contentService     = contentService;
     _persistenceHelper  = persistenceHelper;
     _userService        = userService;
 }
 private static DataBlockService BuildDataBlockService(
     ContentDbContext contentDbContext,
     IMapper mapper = null,
     IPersistenceHelper <ContentDbContext> persistenceHelper = null,
     IUserService userService = null,
     IReleaseFileService releaseFileService = null)
 {
     return(new DataBlockService(
                contentDbContext,
                mapper ?? MapperUtils.AdminMapper(),
                persistenceHelper ?? new PersistenceHelper <ContentDbContext>(contentDbContext),
                userService ?? MockUtils.AlwaysTrueUserService().Object,
                releaseFileService ?? new Mock <IReleaseFileService>().Object
                ));
 }
 private static ManageContentPageService SetupManageContentPageService(
     ContentDbContext contentDbContext,
     IPersistenceHelper <ContentDbContext> contentPersistenceHelper = null,
     IContentService contentService = null,
     IMapper mapper = null,
     IReleaseFileService releaseFileService = null,
     IUserService userService = null)
 {
     return(new ManageContentPageService(
                mapper ?? MapperUtils.AdminMapper(),
                releaseFileService ?? new Mock <IReleaseFileService>().Object,
                contentService ?? new Mock <IContentService>().Object,
                contentPersistenceHelper ?? new PersistenceHelper <ContentDbContext>(contentDbContext),
                userService ?? MockUtils.AlwaysTrueUserService().Object
                ));
 }
 public ManageContentPageService(ContentDbContext contentDbContext,
                                 IPersistenceHelper <ContentDbContext> persistenceHelper,
                                 IMapper mapper,
                                 IContentService contentService,
                                 IMethodologyVersionRepository methodologyVersionRepository,
                                 IReleaseFileService releaseFileService,
                                 IUserService userService)
 {
     _contentDbContext             = contentDbContext;
     _persistenceHelper            = persistenceHelper;
     _mapper                       = mapper;
     _contentService               = contentService;
     _methodologyVersionRepository = methodologyVersionRepository;
     _releaseFileService           = releaseFileService;
     _userService                  = userService;
 }
예제 #10
0
 public DataBlockService(ContentDbContext context,
                         IPersistenceHelper <ContentDbContext> persistenceHelper,
                         IReleaseFileService releaseFileService,
                         IReleaseContentBlockRepository releaseContentBlockRepository,
                         IUserService userService,
                         IMapper mapper,
                         IBlobCacheService cacheService,
                         ICacheKeyService cacheKeyService)
 {
     _context                       = context;
     _persistenceHelper             = persistenceHelper;
     _releaseFileService            = releaseFileService;
     _releaseContentBlockRepository = releaseContentBlockRepository;
     _userService                   = userService;
     _mapper          = mapper;
     _cacheService    = cacheService;
     _cacheKeyService = cacheKeyService;
 }
예제 #11
0
 public ReleasesController(
     IReleaseService releaseService,
     IReleaseFileService releaseFileService,
     IReleaseDataFileService releaseDataFileService,
     IReleaseStatusService releaseStatusService,
     IReleaseChecklistService releaseChecklistService,
     UserManager <ApplicationUser> userManager,
     IDataBlockService dataBlockService,
     IImportService importService)
 {
     _releaseService          = releaseService;
     _releaseDataFileService  = releaseDataFileService;
     _releaseFileService      = releaseFileService;
     _releaseStatusService    = releaseStatusService;
     _releaseChecklistService = releaseChecklistService;
     _userManager             = userManager;
     _dataBlockService        = dataBlockService;
     _importService           = importService;
 }
 public TopicService(
     ContentDbContext contentContext,
     StatisticsDbContext statisticsContext,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IMapper mapper,
     IUserService userService,
     IReleaseSubjectService releaseSubjectService,
     IReleaseDataFileService releaseDataFileService,
     IReleaseFileService releaseFileService,
     IPublishingService publishingService)
 {
     _contentContext         = contentContext;
     _statisticsContext      = statisticsContext;
     _persistenceHelper      = persistenceHelper;
     _mapper                 = mapper;
     _userService            = userService;
     _releaseSubjectService  = releaseSubjectService;
     _releaseDataFileService = releaseDataFileService;
     _releaseFileService     = releaseFileService;
     _publishingService      = publishingService;
 }
 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()
                ));
 }
 private TopicService SetupTopicService(
     ContentDbContext contentContext       = null,
     StatisticsDbContext statisticsContext = null,
     PersistenceHelper <ContentDbContext> persistenceHelper = null,
     IMapper mapper           = null,
     IUserService userService = null,
     IReleaseSubjectService releaseSubjectService   = null,
     IReleaseDataFileService releaseDataFileService = null,
     IReleaseFileService releaseFileService         = null,
     IPublishingService publishingService           = null)
 {
     return(new TopicService(
                contentContext ?? new Mock <ContentDbContext>().Object,
                statisticsContext ?? new Mock <StatisticsDbContext>().Object,
                persistenceHelper ?? MockUtils.MockPersistenceHelper <ContentDbContext, Topic>(_topic.Id, _topic).Object,
                mapper ?? AdminMapper(),
                userService ?? MockUtils.AlwaysTrueUserService().Object,
                releaseSubjectService ?? new Mock <IReleaseSubjectService>().Object,
                releaseDataFileService ?? new Mock <IReleaseDataFileService>().Object,
                releaseFileService ?? new Mock <IReleaseFileService>().Object,
                publishingService ?? new Mock <IPublishingService>().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;
 }
예제 #16
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 ReleaseImageController(IReleaseFileService releaseFileService)
 {
     _releaseFileService = releaseFileService;
 }