Exemplo n.º 1
0
 public ColumnCorrelationComponent(
     IOptions <ExplorerOptions> options,
     ILogger <ColumnCorrelationComponent> logger)
 {
     Logger       = logger;
     this.options = options.Value;
 }
Exemplo n.º 2
0
 public ExplorerDataClient(IHttpClientFactory clientFactory, ILogger <ExplorerDataClient> log,
                           IOptionsSnapshot <ExplorerOptions> explorerOptions)
 {
     this._clientFactory   = clientFactory;
     this._log             = log;
     this._explorerOptions = explorerOptions.Value;
 }
 public SampleValuesGeneratorConfig(
     ResultProvider <DistinctValuesComponent.Result> distinctValuesProvider,
     IOptions <ExplorerOptions> options)
 {
     this.distinctValuesProvider = distinctValuesProvider;
     this.options = options.Value;
 }
Exemplo n.º 4
0
        public void CtorWithNullConfigValue_ShouldUSeDefaultOptions()
        {
            var defaultOptions = new ExplorerOptions();
            var pathMap        = new PathMapService(Options.Create <ExplorerOptions>(null));

            Assert.That(pathMap.PhysicalRoot, Is.EqualTo(Path.GetFullPath(defaultOptions.EditorRoot)));
            Assert.That(pathMap.VirtualRoot, Is.EqualTo(defaultOptions.VirtualRoot));
        }
Exemplo n.º 5
0
        private IPathMapService GetPathMapService(string localRoot, string virtulRoot = "home")
        {
            var config = new ExplorerOptions
            {
                EditorRoot  = localRoot,
                VirtualRoot = virtulRoot
            };

            return(new PathMapService(Options.Create(config)));
        }
Exemplo n.º 6
0
        public void CtorWithExplicitNullConfigParams_ShouldTrhowException()
        {
            var badPathConfig = new ExplorerOptions {
                EditorRoot = ""
            };
            var badVirtualRootConfig = new ExplorerOptions {
                VirtualRoot = ""
            };

            Assert.That(() => new PathMapService(Options.Create(badPathConfig)), Throws.ArgumentException);
            Assert.That(() => new PathMapService(Options.Create(badVirtualRootConfig)), Throws.ArgumentException);
        }
Exemplo n.º 7
0
 public TextGeneratorComponent(
     ResultProvider <EmailCheckComponent.Result> emailCheckProvider,
     ResultProvider <DistinctValuesComponent.Result> distinctValuesProvider,
     ResultProvider <TextLengthDistribution.Result> textLengthDistributionProvider,
     ResultProvider <SampleValuesGeneratorConfig.Result> sampleValuesGeneratorConfigProvider,
     IOptions <ExplorerOptions> options)
 {
     this.emailCheckProvider                  = emailCheckProvider;
     this.distinctValuesProvider              = distinctValuesProvider;
     this.textLengthDistributionProvider      = textLengthDistributionProvider;
     this.sampleValuesGeneratorConfigProvider = sampleValuesGeneratorConfigProvider;
     this.options = options.Value;
 }
        public ExplorerDataControllerTest()
        {
            var loggerFactory = new LoggerFactory();

            loggerFactory.AddConsole();
            _logger = loggerFactory.CreateLogger <ExplorerDataController>();

            var config = new ExplorerOptions
            {
                EditorRoot        = FilePath.Combine(Directory.GetCurrentDirectory(), contentRoot),
                CreateIfNotExists = true
            };

            _pathMapService = new PathMapService(Options.Create(config));
            editorRoot      = new FolderUtil(config.EditorRoot);
        }
Exemplo n.º 9
0
        public void Ctor_ShouldCreateEdiorRoot_IfNotExists()
        {
            var rootPath = FilePath.Combine(Directory.GetCurrentDirectory(), "../../../editor-root1");

            if (Directory.Exists(rootPath))
            {
                Directory.Delete(rootPath, true);
            }

            var config = new ExplorerOptions
            {
                EditorRoot        = rootPath,
                CreateIfNotExists = true
            };

            GetPathMapService(config);

            Assert.That(Directory.Exists(rootPath));
            Directory.Delete(rootPath);
        }
Exemplo n.º 10
0
 public DistinctValuesComponent(IOptions <ExplorerOptions> options)
 {
     this.options = options.Value;
 }
Exemplo n.º 11
0
 private IPathMapService GetPathMapService(ExplorerOptions config)
 {
     return(new PathMapService(Options.Create(config)));
 }
Exemplo n.º 12
0
 public TextLengthDistribution(IOptions <ExplorerOptions> options)
 {
     this.options = options.Value;
 }