static ResultsSearchService CreateResultsSearchService(
     ILogger logger = null,
     ISearchRepository <ProviderIndex> searchRepository = null,
     IResultsResiliencePolicies resiliencePolicies      = null)
 {
     return(new ResultsSearchService(
                logger ?? CreateLogger(),
                searchRepository ?? CreateSearchRepository(),
                resiliencePolicies ?? ResultsResilienceTestHelper.GenerateTestPolicies()));
 }
 static CalculationProviderResultsSearchService CreateTestResultsSearchService(
     ILogger logger = null,
     ISearchRepository <CalculationProviderResultsIndex> serachRepository = null,
     IResultsResiliencePolicies resiliencePolicies = null,
     ISearchRepository <ProviderCalculationResultsIndex> providerCalculationResultsSearchRepository = null,
     IFeatureToggle featureToggle = null)
 {
     return(new CalculationProviderResultsSearchService(
                logger ?? CreateLogger(),
                serachRepository ?? CreateSearchRepository(),
                resiliencePolicies ?? ResultsResilienceTestHelper.GenerateTestPolicies()));
 }
        static ProviderCalculationResultsSearchService CreateTestResultsSearchService(
            ILogger logger = null,
            ISearchRepository <ProviderCalculationResultsIndex> serachRepository = null,
            IResultsResiliencePolicies resiliencePolicies = null)
        {
            IFeatureToggle featureToggle = Substitute.For <IFeatureToggle>();

            featureToggle.IsExceptionMessagesEnabled().Returns(true);
            return(new ProviderCalculationResultsSearchService(
                       logger ?? CreateLogger(),
                       serachRepository ?? CreateSearchRepository(),
                       resiliencePolicies ?? ResultsResilienceTestHelper.GenerateTestPolicies(),
                       featureToggle));
        }
        static PublishedResultsService CreateResultsService(ILogger logger       = null,
                                                            IMapper mapper       = null,
                                                            ITelemetry telemetry = null,
                                                            ICalculationResultsRepository resultsRepository    = null,
                                                            ISpecificationsRepository specificationsRepository = null,
                                                            IResultsResiliencePolicies resiliencePolicies      = null,
                                                            IPublishedProviderResultsAssemblerService publishedProviderResultsAssemblerService = null,
                                                            IPublishedProviderResultsRepository publishedProviderResultsRepository             = null,
                                                            ICacheProvider cacheProvider = null,
                                                            ISearchRepository <AllocationNotificationFeedIndex> allocationNotificationFeedSearchRepository = null,
                                                            IProfilingApiClient profilingApiClient = null,
                                                            IMessengerService messengerService     = null,
                                                            IVersionRepository <PublishedAllocationLineResultVersion> publishedProviderResultsVersionRepository    = null,
                                                            IPublishedAllocationLineLogicalResultVersionService publishedAllocationLineLogicalResultVersionService = null,
                                                            IFeatureToggle featureToggle = null,
                                                            IJobsApiClient jobsApiClient = null,
                                                            IPublishedProviderResultsSettings publishedProviderResultsSettings = null,
                                                            IProviderChangesRepository providerChangesRepository = null,
                                                            IProviderVariationsService providerVariationsService = null,
                                                            IProviderVariationsStorageRepository providerVariationsStorageRepository = null)
        {
            ISpecificationsRepository specsRepo = specificationsRepository ?? CreateSpecificationsRepository();

            return(new PublishedResultsService(
                       logger ?? CreateLogger(),
                       mapper ?? CreateMapper(),
                       telemetry ?? CreateTelemetry(),
                       resultsRepository ?? CreateResultsRepository(),
                       specsRepo,
                       resiliencePolicies ?? ResultsResilienceTestHelper.GenerateTestPolicies(),
                       publishedProviderResultsAssemblerService ?? CreateResultsAssembler(),
                       publishedProviderResultsRepository ?? CreatePublishedProviderResultsRepository(),
                       cacheProvider ?? CreateCacheProvider(),
                       allocationNotificationFeedSearchRepository ?? CreateAllocationNotificationFeedSearchRepository(),
                       profilingApiClient ?? CreateProfilingRepository(),
                       messengerService ?? CreateMessengerService(),
                       publishedProviderResultsVersionRepository ?? CreatePublishedProviderResultsVersionRepository(),
                       publishedAllocationLineLogicalResultVersionService ?? CreatePublishedAllocationLineLogicalResultVersionService(),
                       featureToggle ?? CreateFeatureToggle(),
                       jobsApiClient ?? CreateJobsApiClient(),
                       publishedProviderResultsSettings ?? CreatePublishedProviderResultsSettings(),
                       providerChangesRepository ?? CreateProviderChangesRepository(),
                       providerVariationsService ?? CreateProviderVariationsService(CreateProviderVariationAssemblerService(), specsRepo),
                       providerVariationsStorageRepository ?? CreateProviderVariationsStorageRepository()
                       ));
        }
Esempio n. 5
0
 static AllocationNotificationsFeedsSearchService CreateSearchService(ISearchRepository <AllocationNotificationFeedIndex> searchRepository = null)
 {
     return(new AllocationNotificationsFeedsSearchService(searchRepository ?? CreateSearchRepository(), ResultsResilienceTestHelper.GenerateTestPolicies()));
 }