public ColumnCorrelationComponent( IOptions <ExplorerOptions> options, ILogger <ColumnCorrelationComponent> logger) { Logger = logger; this.options = options.Value; }
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; }
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)); }
private IPathMapService GetPathMapService(string localRoot, string virtulRoot = "home") { var config = new ExplorerOptions { EditorRoot = localRoot, VirtualRoot = virtulRoot }; return(new PathMapService(Options.Create(config))); }
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); }
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); }
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); }
public DistinctValuesComponent(IOptions <ExplorerOptions> options) { this.options = options.Value; }
private IPathMapService GetPathMapService(ExplorerOptions config) { return(new PathMapService(Options.Create(config))); }
public TextLengthDistribution(IOptions <ExplorerOptions> options) { this.options = options.Value; }