private static AssignSpecificationProviderVersionModelValidator CreateValidator(ISpecificationsRepository repository = null, IProvidersApiClient providersApiClient = null ) { return(new AssignSpecificationProviderVersionModelValidator(repository ?? CreateSpecificationsRepository(), providersApiClient ?? CreateProviderApiClient(), SpecificationsResilienceTestHelper.GenerateTestPolicies())); }
private SpecificationsService CreateService( IMapper mapper = null, ISpecificationsRepository specificationsRepository = null, IPoliciesApiClient policiesApiClient = null, ILogger logs = null, IValidator <SpecificationCreateModel> specificationCreateModelvalidator = null, IMessengerService messengerService = null, ISearchRepository <SpecificationIndex> searchRepository = null, IValidator <AssignDefinitionRelationshipMessage> assignDefinitionRelationshipMessageValidator = null, ICacheProvider cacheProvider = null, IValidator <SpecificationEditModel> specificationEditModelValidator = null, IResultsRepository resultsRepository = null, IVersionRepository <Models.Specs.SpecificationVersion> specificationVersionRepository = null, IQueueCreateSpecificationJobActions queueCreateSpecificationJobActions = null, IQueueEditSpecificationJobActions queueEditSpecificationJobActions = null, IQueueDeleteSpecificationJobActions queueDeleteSpecificationJobActions = null, IFeatureToggle featureToggle = null, ICalculationsApiClient calcsApiClient = null, IProvidersApiClient providersApiClient = null, IValidator <AssignSpecificationProviderVersionModel> assignSpecificationProviderVersionModelValidator = null) { return(new SpecificationsService( mapper ?? CreateMapper(), specificationsRepository ?? CreateSpecificationsRepository(), policiesApiClient ?? CreatePoliciesApiClient(), logs ?? CreateLogger(), specificationCreateModelvalidator ?? CreateSpecificationValidator(), messengerService ?? CreateMessengerService(), searchRepository ?? CreateSearchRepository(), assignDefinitionRelationshipMessageValidator ?? CreateAssignDefinitionRelationshipMessageValidator(), cacheProvider ?? CreateCacheProvider(), specificationEditModelValidator ?? CreateEditSpecificationValidator(), resultsRepository ?? CreateResultsRepository(), specificationVersionRepository ?? CreateVersionRepository(), SpecificationsResilienceTestHelper.GenerateTestPolicies(), queueCreateSpecificationJobActions ?? Substitute.For <IQueueCreateSpecificationJobActions>(), queueEditSpecificationJobActions ?? CreateQueueEditSpecificationJobActions(), queueDeleteSpecificationJobActions ?? Substitute.For <IQueueDeleteSpecificationJobActions>(), calcsApiClient ?? CreateCalcsApiClient(), featureToggle ?? Substitute.For <IFeatureToggle>(), providersApiClient ?? Substitute.For <IProvidersApiClient>(), _specificationIndexer, _resultsApiClient, _templateVersionChangedHandler, assignSpecificationProviderVersionModelValidator ?? CreateAssignSpecificationProviderVersionModelValidator(), CreateJobManagement())); }
private SpecificationsService CreateService( IMapper mapper = null, ISpecificationsRepository specificationsRepository = null, ILogger logs = null, IValidator <PolicyCreateModel> policyCreateModelValidator = null, IValidator <SpecificationCreateModel> specificationCreateModelvalidator = null, IValidator <CalculationCreateModel> calculationCreateModelValidator = null, IMessengerService messengerService = null, ServiceBusSettings EventHubSettings = null, ISearchRepository <SpecificationIndex> searchRepository = null, IValidator <AssignDefinitionRelationshipMessage> assignDefinitionRelationshipMessageValidator = null, ICacheProvider cacheProvider = null, IValidator <SpecificationEditModel> specificationEditModelValidator = null, IValidator <PolicyEditModel> policyEditModelValidator = null, IValidator <CalculationEditModel> calculationEditModelValidator = null, IResultsRepository resultsRepository = null, IVersionRepository <SpecificationVersion> specificationVersionRepository = null, IFeatureToggle featureToggle = null, IJobsApiClient jobsApiClient = null) { return(new SpecificationsService(mapper ?? CreateMapper(), specificationsRepository ?? CreateSpecificationsRepository(), logs ?? CreateLogger(), policyCreateModelValidator ?? CreatePolicyValidator(), specificationCreateModelvalidator ?? CreateSpecificationValidator(), calculationCreateModelValidator ?? CreateCalculationValidator(), messengerService ?? CreateMessengerService(), searchRepository ?? CreateSearchRepository(), assignDefinitionRelationshipMessageValidator ?? CreateAssignDefinitionRelationshipMessageValidator(), cacheProvider ?? CreateCacheProvider(), specificationEditModelValidator ?? CreateEditSpecificationValidator(), policyEditModelValidator ?? CreateEditPolicyValidator(), calculationEditModelValidator ?? CreateEditCalculationValidator(), resultsRepository ?? CreateResultsRepository(), specificationVersionRepository ?? CreateVersionRepository(), featureToggle ?? CreateFeatureToggle(), jobsApiClient ?? CreateJobsApiClient(), SpecificationsResilienceTestHelper.GenerateTestPolicies() )); }