Пример #1
0
        public Fixture()
        {
            var configuration = new ConfigurationBuilder()
                                .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "Esquio.Configuration.Store"))
                                .AddJsonFile("appsettings.json")
                                .Build();

            var serviceProvider = new ServiceCollection()
                                  .AddOptions()
                                  .Configure <EsquioConfiguration>(configuration.GetSection("Esquio"))
                                  .BuildServiceProvider();

            var loggerFactory = new LoggerFactory();
            var diagnostics   = new EsquioConfigurationStoreDiagnostics(loggerFactory);

            var options = serviceProvider.GetService <IOptionsSnapshot <EsquioConfiguration> >();

            FeatureStore = new ConfigurationFeatureStore(options, diagnostics);
        }
 public ConfigurationFeatureStore(IOptionsSnapshot <EsquioConfiguration> options, EsquioConfigurationStoreDiagnostics diagnostics)
 {
     _options     = options ?? throw new ArgumentNullException(nameof(options));
     _diagnostics = diagnostics ?? throw new ArgumentNullException(nameof(diagnostics));
 }