Esempio n. 1
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");
 }
Esempio n. 2
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;
 }
Esempio n. 3
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>()
                ));
 }