private static ReleaseService BuildReleaseService(
     ContentDbContext contentDbContext,
     StatisticsDbContext statisticsDbContext      = null,
     IFileStorageService fileStorageService       = null,
     IReleaseSubjectService releaseSubjectService = null)
 {
     return(new ReleaseService(
                contentDbContext,
                statisticsDbContext ?? new Mock <StatisticsDbContext>().Object,
                fileStorageService ?? new Mock <IFileStorageService>().Object,
                releaseSubjectService ?? new Mock <IReleaseSubjectService>().Object,
                new Mock <ILogger <ReleaseService> >().Object,
                MapperForProfile <MappingProfiles>()));
 }
示例#2
0
 public ReleaseService(ContentDbContext contentDbContext,
                       StatisticsDbContext statisticsDbContext,
                       IFileStorageService fileStorageService,
                       IReleaseSubjectService releaseSubjectService,
                       ILogger <ReleaseService> logger,
                       IMapper mapper)
 {
     _contentDbContext      = contentDbContext;
     _statisticsDbContext   = statisticsDbContext;
     _fileStorageService    = fileStorageService;
     _releaseSubjectService = releaseSubjectService;
     _logger = logger;
     _mapper = mapper;
 }
 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
                ));
 }
示例#6
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;
 }