Esempio n. 1
0
        public ValidationOutcomeProcessor(
            IValidationStorageService validationStorageService,
            IPackageValidationEnqueuer validationEnqueuer,
            IPackageStatusProcessor validatedPackageProcessor,
            IValidationPackageFileService packageFileService,
            IOptionsSnapshot <ValidationConfiguration> validationConfigurationAccessor,
            IMessageService messageService,
            ITelemetryService telemetryService,
            ILogger <ValidationOutcomeProcessor> logger)
        {
            _validationStorageService = validationStorageService ?? throw new ArgumentNullException(nameof(validationStorageService));
            _validationEnqueuer       = validationEnqueuer ?? throw new ArgumentNullException(nameof(validationEnqueuer));
            _packageStateProcessor    = validatedPackageProcessor ?? throw new ArgumentNullException(nameof(validatedPackageProcessor));
            _packageFileService       = packageFileService ?? throw new ArgumentNullException(nameof(packageFileService));
            if (validationConfigurationAccessor == null)
            {
                throw new ArgumentNullException(nameof(validationConfigurationAccessor));
            }
            _validationConfiguration = validationConfigurationAccessor.Value
                                       ?? throw new ArgumentException($"The {nameof(validationConfigurationAccessor)}.Value property cannot be null",
                                                                      nameof(validationConfigurationAccessor));
            _messageService   = messageService ?? throw new ArgumentNullException(nameof(messageService));
            _telemetryService = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
            _logger           = logger ?? throw new ArgumentNullException(nameof(logger));

            _validationConfigurationsByName = _validationConfiguration.Validations.ToDictionary(v => v.Name);
        }
Esempio n. 2
0
 public ValidationStorageService(
     IValidationEntitiesContext validationContext,
     IValidationPackageFileService packageFileService,
     IValidatorProvider validatorProvider,
     ITelemetryService telemetryService,
     ILogger <ValidationStorageService> logger)
 {
     _validationContext  = validationContext ?? throw new ArgumentNullException(nameof(validationContext));
     _packageFileService = packageFileService ?? throw new ArgumentNullException(nameof(packageFileService));
     _validatorProvider  = validatorProvider ?? throw new ArgumentNullException(nameof(validatorProvider));
     _telemetryService   = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 public PackageStatusProcessor(
     ICorePackageService galleryPackageService,
     IValidationPackageFileService packageFileService,
     IValidatorProvider validatorProvider,
     ITelemetryService telemetryService,
     ILogger <PackageStatusProcessor> logger)
 {
     _galleryPackageService = galleryPackageService ?? throw new ArgumentNullException(nameof(galleryPackageService));
     _packageFileService    = packageFileService ?? throw new ArgumentNullException(nameof(packageFileService));
     _validatorProvider     = validatorProvider ?? throw new ArgumentNullException(nameof(validatorProvider));
     _telemetryService      = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 public ValidationSetProcessor(
     IValidatorProvider validatorProvider,
     IValidationStorageService validationStorageService,
     IOptionsSnapshot <ValidationConfiguration> validationConfigurationAccessor,
     IValidationPackageFileService packageFileService,
     ITelemetryService telemetryService,
     ILogger <ValidationSetProcessor> logger)
 {
     _validatorProvider        = validatorProvider ?? throw new ArgumentNullException(nameof(validatorProvider));
     _validationStorageService = validationStorageService ?? throw new ArgumentNullException(nameof(validationStorageService));
     if (validationConfigurationAccessor == null)
     {
         throw new ArgumentNullException(nameof(validationConfigurationAccessor));
     }
     _validationConfiguration = validationConfigurationAccessor.Value ?? throw new ArgumentException($"The Value property cannot be null", nameof(validationConfigurationAccessor));
     _packageFileService      = packageFileService ?? throw new ArgumentNullException(nameof(packageFileService));
     _telemetryService        = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }