public MethodMainViewModel(IEventAggregator aggregator, IDataService <LabDbEntities> labDbData, ISpecificationService specificationService) : base() { _labDbData = labDbData; _eventAggregator = aggregator; _specificationService = specificationService; DeleteMethodCommand = new DelegateCommand( () => { _selectedMethod.Delete(); }, () => IsSpecAdmin && _selectedMethod != null); NewMethodCommand = new DelegateCommand( () => { _specificationService.CreateMethod(); }, () => IsSpecAdmin); _eventAggregator.GetEvent <MethodChanged>().Subscribe( tkn => RaisePropertyChanged("MethodList")); }
public PublishedProviderStatusService( ISpecificationIdServiceRequestValidator validator, ISpecificationService specificationService, IPublishedFundingRepository publishedFundingRepository, IPublishingResiliencePolicies publishingResiliencePolicies, IPublishedProviderFundingCountProcessor fundingCountProcessor, IPublishedProviderFundingCsvDataProcessor fundingCsvDataProcessor, ICsvUtils csvUtils, IBlobClient blobClient) { Guard.ArgumentNotNull(validator, nameof(validator)); Guard.ArgumentNotNull(specificationService, nameof(specificationService)); Guard.ArgumentNotNull(publishedFundingRepository, nameof(publishedFundingRepository)); Guard.ArgumentNotNull(publishingResiliencePolicies, nameof(publishingResiliencePolicies)); Guard.ArgumentNotNull(publishingResiliencePolicies.PublishedFundingRepository, nameof(publishingResiliencePolicies.PublishedFundingRepository)); Guard.ArgumentNotNull(publishingResiliencePolicies.SpecificationsRepositoryPolicy, nameof(publishingResiliencePolicies.SpecificationsRepositoryPolicy)); Guard.ArgumentNotNull(publishingResiliencePolicies.BlobClient, nameof(publishingResiliencePolicies.BlobClient)); Guard.ArgumentNotNull(fundingCountProcessor, nameof(fundingCountProcessor)); Guard.ArgumentNotNull(fundingCsvDataProcessor, nameof(fundingCsvDataProcessor)); Guard.ArgumentNotNull(csvUtils, nameof(csvUtils)); Guard.ArgumentNotNull(blobClient, nameof(blobClient)); _validator = validator; _specificationService = specificationService; _publishedFundingRepository = publishedFundingRepository; _fundingCountProcessor = fundingCountProcessor; _publishedFundingRepositoryResilience = publishingResiliencePolicies.PublishedFundingRepository; _specificationsRepositoryPolicy = publishingResiliencePolicies.SpecificationsRepositoryPolicy; _blobClientPolicy = publishingResiliencePolicies.BlobClient; _fundingCsvDataProcessor = fundingCsvDataProcessor; _csvUtils = csvUtils; _blobClient = blobClient; }
public SpecificationsController( ISpecificationService specificationService, IMapper mapper) { _service = specificationService; _mapper = mapper; }
public void SetUp() { _specificationId = NewRandomString(); _validationResult = new ValidationResult(); _validator = Substitute.For <ISpecificationIdServiceRequestValidator>(); _validator.Validate(_specificationId) .Returns(_validationResult); _specificationService = Substitute.For <ISpecificationService>(); _publishedFundingRepository = Substitute.For <IPublishedFundingRepository>(); _fundingCountProcessor = Substitute.For <IPublishedProviderFundingCountProcessor>(); _fundingCsvDataProcessor = Substitute.For <IPublishedProviderFundingCsvDataProcessor>(); _csvUtils = Substitute.For <ICsvUtils>(); _blobClient = Substitute.For <IBlobClient>(); _service = new PublishedProviderStatusService(_validator, _specificationService, _publishedFundingRepository, new ResiliencePolicies { PublishedFundingRepository = Polly.Policy.NoOpAsync(), SpecificationsRepositoryPolicy = Polly.Policy.NoOpAsync(), BlobClient = Polly.Policy.NoOpAsync() }, _fundingCountProcessor, _fundingCsvDataProcessor, _csvUtils, _blobClient); }
public void CheckChooseForFundingStatus_GivenSpecificationSummaryNotFound_ThrowsEntityNotFoundException() { //Arrange SpecificationSummary specificationSummary = null; string errorMessage = $"Failed to find specification with for specification Id '{specificationId}'"; ILogger logger = CreateLogger(); ISpecificationService specificationService = CreateSpecificationService(); specificationService .GetSpecificationSummaryById(Arg.Is(specificationId)) .Returns(specificationSummary); SpecificationFundingStatusService specificationFundingStatusService = CreateSpecificationFundingStatusService(logger, specificationService); //Act Func <Task> test = async() => await specificationFundingStatusService.CheckChooseForFundingStatus(specificationId); //Assert test .Should() .ThrowExactly <EntityNotFoundException>() .Which .Message .Should() .Be(errorMessage); logger .Received(1) .Error(Arg.Is(errorMessage)); }
public SpecificationMainViewModel(IEventAggregator aggregator, IDataService <LabDbEntities> labDbData, ISpecificationService specificationService) : base() { _labDbData = labDbData; _eventAggregator = aggregator; _specificationService = specificationService; NewSpecificationCommand = new DelegateCommand( () => { _specificationService.CreateSpecification(); }, () => Thread.CurrentPrincipal.IsInRole(UserRoleNames.SpecificationEdit)); OpenSpecificationCommand = new DelegateCommand <Specification>( spec => { NavigationToken token = new NavigationToken(SpecificationViewNames.SpecificationEdit, SelectedSpecification); _eventAggregator.GetEvent <NavigationRequested>().Publish(token); }); #region EventSubscriptions _eventAggregator.GetEvent <SpecificationChanged>() .Subscribe(token => { RaisePropertyChanged("SpecificationList"); }); #endregion EventSubscriptions }
public async Task CheckChooseForFundingStatus_GivenNoSpecSummariesFoundForFundingPeriodId_ReturnsCanChoose() { //Arrange SpecificationSummary specificationSummary = new SpecificationSummary { FundingPeriod = new Reference { Id = fundingPeriodId } }; ISpecificationService specificationService = CreateSpecificationService(); specificationService .GetSpecificationSummaryById(Arg.Is(specificationId)) .Returns(specificationSummary); specificationService .GetSpecificationsSelectedForFundingByPeriod(Arg.Is(fundingPeriodId)) .Returns((IEnumerable <SpecificationSummary>)null); SpecificationFundingStatusService specificationFundingStatusService = CreateSpecificationFundingStatusService(specificationService: specificationService); //Act SpecificationFundingStatus status = await specificationFundingStatusService.CheckChooseForFundingStatus(specificationId); //Assert status .Should() .Be(SpecificationFundingStatus.CanChoose); }
private static SpecificationFundingStatusService CreateSpecificationFundingStatusService( ILogger logger = null, ISpecificationService specificationService = null) { return(new SpecificationFundingStatusService( logger ?? CreateLogger(), specificationService ?? CreateSpecificationService())); }
public override void Execute(ILinearTransitionContext ctx) { SpecLinearTransitionContext transitionContext = (SpecLinearTransitionContext)ctx; ISpecificationService specService = transitionContext.SpecificationService; IBaseSpec spec = (IBaseSpec)specService.Current; Utils.SaveIntegrationStatus(spec.PKID, spec.SpecSummary.WorkflowStatus.Status, null); }
public ViewHelper( ICategoryService categoryService, IManufacturerService manufacturerService, ISpecificationService specificationService) { _categoryService = categoryService; _manufacturerService = manufacturerService; _specificationService = specificationService; }
public async Task CheckChooseForFundingStatus_GivenSpecWIthMultipleFundingStreamsAndSpecsReturnedForFundingPeriodWithSameFundingStream_ReturnsSharesAlreadyChoseFundingStream() { //Arrange SpecificationSummary specificationSummary = new SpecificationSummary { FundingPeriod = new Reference { Id = fundingPeriodId }, FundingStreams = new[] { new Reference("fs-2", "fs2"), new Reference("fs-4", "fs4") } }; IEnumerable <SpecificationSummary> specificationSummaries = new[] { new SpecificationSummary { FundingStreams = new[] { new Reference("fs-1", "fs1"), new Reference("fs-5", "fs5"), } }, new SpecificationSummary { FundingStreams = new[] { new Reference("fs-3", "fs3"), new Reference("fs-4", "fs4"), } } }; ISpecificationService specificationService = CreateSpecificationService(); specificationService .GetSpecificationSummaryById(Arg.Is(specificationId)) .Returns(specificationSummary); specificationService .GetSpecificationsSelectedForFundingByPeriod(Arg.Is(fundingPeriodId)) .Returns(specificationSummaries); SpecificationFundingStatusService specificationFundingStatusService = CreateSpecificationFundingStatusService(specificationService: specificationService); //Act SpecificationFundingStatus status = await specificationFundingStatusService.CheckChooseForFundingStatus(specificationId); //Assert status .Should() .Be(SpecificationFundingStatus.SharesAlreadyChosenFundingStream); }
public SpecificationFundingStatusService( ILogger logger, ISpecificationService specificationService) { Guard.ArgumentNotNull(logger, nameof(logger)); Guard.ArgumentNotNull(specificationService, nameof(specificationService)); _logger = logger; _specificationService = specificationService; }
public DataHelper( ICategoryService categoryService, IManufacturerService manufacturerService, IProductService productService, ISpecificationService specificationService) { _categoryService = categoryService; _manufacturerService = manufacturerService; _productService = productService; _specificationService = specificationService; }
public SpecificationController( ISpecificationService specificationService, IHttpContextAccessor httpContextAccessor, DataHelper dataHelper, IMapper mapper) { _specificationService = specificationService; _httpContextAccessor = httpContextAccessor; _dataHelper = dataHelper; _mapper = mapper; }
public SpecificationViewModelService( IMapper mapper, ISpecificationService specificationService, ICategoryService categoryService, IVideoSourceService videoSourceService, IArticleSourceService articleSourceService) { _mapper = mapper; _specificationService = specificationService; _categoryService = categoryService; _videoSourceService = videoSourceService; _articleSourceService = articleSourceService; }
public HomeController(IUserService userService, ICategoryService categoryService, ISpecificationService specificationService, IManufacturerService manufacturerService, IProductService productService, IProductDetailService productDetailService, ICustomerService customerService, IQueryService queryService) { this.userService = userService; this.categoryService = categoryService; this.specificationService = specificationService; this.manufacturerService = manufacturerService; this.productService = productService; this.productDetailService = productDetailService; this.customerService = customerService; this.queryService = queryService; }
public MarkService( IMarkRepo markRepo, ISubnodeRepo subnodeRepo, IDepartmentRepo departmentRepo, IEmployeeRepo employeeRepo, ISpecificationService specificationService) { _repository = markRepo; _subnodeRepo = subnodeRepo; _departmentRepo = departmentRepo; _employeeRepo = employeeRepo; _specificationService = specificationService; }
/// <summary> /// Initializes a new instance of the <see cref="Accumulator"/> class /// </summary> /// <param name="strategyService"> A service from which the algorithmic strategies are retrieved </param> /// <param name="specificationService"> A service of specifications that the sentence (or path) must satisfy </param> public Accumulator(IStrategyService strategyService, ISpecificationService specificationService) { if (strategyService == null) { throw new ArgumentNullException("strategyService"); } if (specificationService == null) { throw new ArgumentNullException("specificationService"); } this._strategyService = strategyService; this._specificationService = specificationService; }
public void SetUp() { _logger = Substitute.For <ILogger>(); _publishedFundingRepository = Substitute.For <IPublishedFundingRepository>(); _specificationService = Substitute.For <ISpecificationService>(); _policiesService = Substitute.For <IPoliciesService>(); _calculationsService = Substitute.For <ICalculationsService>(); _service = new PublishedProviderFundingStructureService( _logger, _publishedFundingRepository, _specificationService, _policiesService, _calculationsService); }
public PublishedProviderFundingService(IPublishingResiliencePolicies resiliencePolicies, IPublishedFundingDataService publishedFunding, ISpecificationService specificationService, ISpecificationIdServiceRequestValidator validator) { Guard.ArgumentNotNull(resiliencePolicies?.PublishedFundingRepository, nameof(resiliencePolicies.PublishedFundingRepository)); Guard.ArgumentNotNull(publishedFunding, nameof(publishedFunding)); Guard.ArgumentNotNull(specificationService, nameof(specificationService)); Guard.ArgumentNotNull(validator, nameof(validator)); _resiliencePolicy = resiliencePolicies.PublishedFundingRepository; _publishedFunding = publishedFunding; _specificationService = specificationService; _validator = validator; }
public MarkService( IMarkRepo markRepo, ISubnodeRepo subnodeRepo, IDepartmentRepo departmentRepo, IEmployeeRepo employeeRepo, IEstimateTaskRepo estimateTaskRepo, ISpecificationService specificationService, IMarkGeneralDataPointService markGeneralDataPointService) { _repository = markRepo; _subnodeRepo = subnodeRepo; _departmentRepo = departmentRepo; _employeeRepo = employeeRepo; _estimateTaskRepo = estimateTaskRepo; _specificationService = specificationService; _markGeneralDataPointService = markGeneralDataPointService; }
public void SetUp() { _specificationFundingStatusService = Substitute.For <ISpecificationFundingStatusService>(); _specificationService = Substitute.For <ISpecificationService>(); _jobsRunning = Substitute.For <IJobsRunning>(); _calculationApprovalCheckerService = Substitute.For <ICalculationPrerequisiteCheckerService>(); _jobManagement = Substitute.For <IJobManagement>(); _logger = Substitute.For <ILogger>(); _refreshPrerequisiteChecker = new RefreshPrerequisiteChecker( _specificationFundingStatusService, _specificationService, _jobsRunning, _calculationApprovalCheckerService, _jobManagement, _logger); }
public RefreshPrerequisiteChecker( ISpecificationFundingStatusService specificationFundingStatusService, ISpecificationService specificationService, IJobsRunning jobsRunning, ICalculationPrerequisiteCheckerService calculationApprovalCheckerService, IJobManagement jobManagement, ILogger logger) : base(jobsRunning, jobManagement, logger) { Guard.ArgumentNotNull(specificationFundingStatusService, nameof(specificationFundingStatusService)); Guard.ArgumentNotNull(specificationService, nameof(specificationService)); Guard.ArgumentNotNull(calculationApprovalCheckerService, nameof(calculationApprovalCheckerService)); Guard.ArgumentNotNull(logger, nameof(logger)); _specificationFundingStatusService = specificationFundingStatusService; _specificationService = specificationService; _calculationApprovalCheckerService = calculationApprovalCheckerService; _logger = logger; }
public ProfileTotalsService( IPublishedFundingRepository publishedFunding, IPublishingResiliencePolicies resiliencePolicies, ISpecificationService specificationService, IPoliciesService policiesService, IProfilingService profilingService) { Guard.ArgumentNotNull(publishedFunding, nameof(publishedFunding)); Guard.ArgumentNotNull(resiliencePolicies?.PublishedFundingRepository, nameof(resiliencePolicies.PublishedFundingRepository)); Guard.ArgumentNotNull(specificationService, nameof(specificationService)); Guard.ArgumentNotNull(policiesService, nameof(policiesService)); Guard.ArgumentNotNull(profilingService, nameof(profilingService)); _resilience = resiliencePolicies.PublishedFundingRepository; _publishedFunding = publishedFunding; _specificationService = specificationService; _policiesService = policiesService; _profilingService = profilingService; }
public PublishedProviderFundingStructureService( ILogger logger, IPublishedFundingRepository publishedFundingRepository, ISpecificationService specificationService, IPoliciesService policiesService, ICalculationsService calculationsService) { Guard.ArgumentNotNull(logger, nameof(logger)); Guard.ArgumentNotNull(publishedFundingRepository, nameof(publishedFundingRepository)); Guard.ArgumentNotNull(specificationService, nameof(specificationService)); Guard.ArgumentNotNull(policiesService, nameof(policiesService)); Guard.ArgumentNotNull(calculationsService, nameof(calculationsService)); _logger = logger; _publishedFundingRepository = publishedFundingRepository; _specificationService = specificationService; _policiesService = policiesService; _calculationsService = calculationsService; }
public PublishedFundingDataService( IPublishedFundingRepository publishedFundingRepository, ISpecificationService specificationService, IPublishingResiliencePolicies publishingResiliencePolicies, IPublishedFundingBulkRepository publishedFundingBulkRepository) { Guard.ArgumentNotNull(publishedFundingRepository, nameof(publishedFundingRepository)); Guard.ArgumentNotNull(specificationService, nameof(specificationService)); Guard.ArgumentNotNull(publishingResiliencePolicies, nameof(publishingResiliencePolicies)); Guard.ArgumentNotNull(publishingResiliencePolicies.PublishedFundingRepository, nameof(publishingResiliencePolicies.PublishedFundingRepository)); Guard.ArgumentNotNull(publishingResiliencePolicies.SpecificationsRepositoryPolicy, nameof(publishingResiliencePolicies.SpecificationsRepositoryPolicy)); Guard.ArgumentNotNull(publishedFundingBulkRepository, nameof(publishedFundingBulkRepository)); _publishedFundingRepository = publishedFundingRepository; _specificationService = specificationService; _publishedFundingRepositoryPolicy = publishingResiliencePolicies.PublishedFundingRepository; _specificationsRepositoryPolicy = publishingResiliencePolicies.SpecificationsRepositoryPolicy; _publishedFundingBulkRepository = publishedFundingBulkRepository; }
public StandardEditViewModel(ISpecificationService specificationService) { _specificationService = specificationService; ConsolidateCommand = new DelegateCommand( () => { Views.ConsolidateStandardDialog consolidateDialog = new Views.ConsolidateStandardDialog(); consolidateDialog.StandardInstance = _standardInstance; consolidateDialog.ShowDialog(); }, () => Thread.CurrentPrincipal.IsInRole(UserRoleNames.SpecificationAdmin)); DeleteCommand = new DelegateCommand( () => { _specificationService.DeleteStandard(_standardInstance); }, () => Thread.CurrentPrincipal.IsInRole(UserRoleNames.SpecificationAdmin)); }
public PublishIntegrityCheckService(IJobManagement jobManagement, ILogger logger, ISpecificationService specificationService, IProviderService providerService, IPublishedFundingContentsPersistanceService publishedFundingContentsPersistanceService, IPublishedProviderContentPersistanceService publishedProviderContentsPersistanceService, IPublishingResiliencePolicies publishingResiliencePolicies, IPublishedFundingDataService publishedFundingDataService, IPoliciesService policiesService, ICalculationsApiClient calculationsApiClient, IPublishedFundingService publishedFundingService, IPublishedProviderContentsGeneratorResolver publishedProviderContentsGeneratorResolver, IPublishedFundingVersionDataService publishedFundingVersionDataService) : base(jobManagement, logger) { Guard.ArgumentNotNull(logger, nameof(logger)); Guard.ArgumentNotNull(specificationService, nameof(specificationService)); Guard.ArgumentNotNull(publishedFundingContentsPersistanceService, nameof(publishedFundingContentsPersistanceService)); Guard.ArgumentNotNull(publishedProviderContentsPersistanceService, nameof(publishedProviderContentsPersistanceService)); Guard.ArgumentNotNull(providerService, nameof(providerService)); Guard.ArgumentNotNull(publishedFundingDataService, nameof(publishedFundingDataService)); Guard.ArgumentNotNull(publishingResiliencePolicies.PublishedFundingRepository, nameof(publishingResiliencePolicies.PublishedFundingRepository)); Guard.ArgumentNotNull(policiesService, nameof(policiesService)); Guard.ArgumentNotNull(calculationsApiClient, nameof(calculationsApiClient)); Guard.ArgumentNotNull(publishingResiliencePolicies.CalculationsApiClient, nameof(publishingResiliencePolicies.CalculationsApiClient)); Guard.ArgumentNotNull(publishedFundingService, nameof(publishedFundingService)); Guard.ArgumentNotNull(publishedProviderContentsGeneratorResolver, nameof(publishedProviderContentsGeneratorResolver)); Guard.ArgumentNotNull(publishedFundingVersionDataService, nameof(publishedFundingVersionDataService)); _logger = logger; _calculationsApiClient = calculationsApiClient; _calculationsApiClientPolicy = publishingResiliencePolicies.CalculationsApiClient; _specificationService = specificationService; _publishedFundingContentsPersistanceService = publishedFundingContentsPersistanceService; _publishedProviderContentsPersistanceService = publishedProviderContentsPersistanceService; _providerService = providerService; _publishedFundingDataService = publishedFundingDataService; _publishingResiliencePolicy = publishingResiliencePolicies.PublishedFundingRepository; _policiesService = policiesService; _publishedProviderContentsGeneratorResolver = publishedProviderContentsGeneratorResolver; _publishedFundingVersionDataService = publishedFundingVersionDataService; }
public ProductController( ICategoryService categoryService, IImageManagerService imageManagerService, IManufacturerService manufacturerService, IProductService productService, ISpecificationService specificationService, IHttpContextAccessor httpContextAccessor, ViewHelper viewHelper, DataHelper dataHelper, IMapper mapper) { _categoryService = categoryService; _imageManagerService = imageManagerService; _manufacturerService = manufacturerService; _productService = productService; _specificationService = specificationService; _httpContextAccessor = httpContextAccessor; _viewHelper = viewHelper; _dataHelper = dataHelper; _mapper = mapper; }
public RefreshStepDefinition(IPublishFundingStepContext publishFundingStepContext, CurrentSpecificationStepContext currentSpecificationStepContext, CurrentJobStepContext currentJobStepContext, CurrentUserStepContext currentUserStepContext, IVariationServiceStepContext variationServiceStepContext, IRefreshService refreshService, IVersionRepository <PublishedProviderVersion> publishedProviderVersionRepository, ICurrentCorrelationStepContext currentCorrelationStepContext, ISpecificationService specificationService) { _publishFundingStepContext = publishFundingStepContext; _currentSpecificationStepContext = currentSpecificationStepContext; _currentJobStepContext = currentJobStepContext; _currentUserStepContext = currentUserStepContext; _variationServiceStepContext = variationServiceStepContext; _refreshService = refreshService; _currentCorrelationStepContext = currentCorrelationStepContext; _providerVersionInMemoryRepository = (PublishedProviderVersionInMemoryRepository)publishedProviderVersionRepository; _specificationInMemoryRepository = (SpecificationInMemoryRepository)specificationService; }
public void SetUp() { _specificationId = NewRandomString(); _validationResult = new ValidationResult(); _fundingPeriodId = NewRandomString(); _fundingStreamId = NewRandomString(); _validator = Substitute.For <ISpecificationIdServiceRequestValidator>(); _validator.Validate(_specificationId) .Returns(_validationResult); _publishedFunding = Substitute.For <IPublishedFundingDataService>(); _specificationService = Substitute.For <ISpecificationService>(); _service = new PublishedProviderFundingService(new ResiliencePolicies { PublishedFundingRepository = Polly.Policy.NoOpAsync() }, _publishedFunding, _specificationService, _validator); }