public ReposIndexer( IGitRepoSearcher searcher, ILogger <ReposIndexer> logger, IRepositoriesCache repoCache, IConfigFileParser configFileParser, IRepoFetcher repoFetcher, ICloudBlobClient cloudClient, IOptionsSnapshot <GitHubIndexerConfiguration> configuration, ITelemetryService telemetry) { _searcher = searcher ?? throw new ArgumentNullException(nameof(searcher)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _repoCache = repoCache ?? throw new ArgumentNullException(nameof(repoCache)); _configFileParser = configFileParser ?? throw new ArgumentNullException(nameof(configFileParser)); _repoFetcher = repoFetcher ?? throw new ArgumentNullException(nameof(repoFetcher)); if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } _maxDegreeOfParallelism = configuration.Value.MaxDegreeOfParallelism; _repoIndexingTimeout = configuration.Value.RepoIndexingTimeout; _sleepAfterSuccess = configuration.Value.SleepAfterSuccess; _cloudClient = cloudClient ?? throw new ArgumentNullException(nameof(cloudClient)); _telemetry = telemetry ?? throw new ArgumentNullException(nameof(telemetry)); }
public ArgumentHandler(IArgumentParser argumentParser, IConfigFileParser configFileParser, IFileSystem fileSystem) { Guard.AgainstNullArgument("argumentParser", argumentParser); Guard.AgainstNullArgument("configFileParser", configFileParser); Guard.AgainstNullArgument("fileSystem", fileSystem); _fileSystem = fileSystem; _argumentParser = argumentParser; _configFileParser = configFileParser; }