public ConfigurationSetFactoryTests() { identity = new ConfigurationIdentity("fbce468f-0950-4b5f-a7e1-8e24e746bb91"); registry = new ConfigurationSetRegistry(); registry.AddConfigurationSet(new TestConfiguationModule().BuildConfigurationSetModel()); defaultOptions = new List <ExternalOption> { new ExternalOption { Id = 1, Description = "testOne" } }; additionalOption = new List <OptionDependentOnAnotherOption> { new OptionDependentOnAnotherOption { Id = 1, ExternalOption = defaultOptions[0], Value = 23.3 } }; mockConfigProvider = new Mock <IConfigProvider>(); mockConfigProvider.Setup(test => test.GetCollectionAsync(typeof(ExternalOption), It.IsAny <ConfigurationIdentity>())) .Returns(() => Task.FromResult <IEnumerable>(defaultOptions)); mockConfigProvider.Setup(test => test.GetCollectionAsync(typeof(OptionDependentOnAnotherOption), It.IsAny <ConfigurationIdentity>())) .Returns(() => Task.FromResult <IEnumerable>(additionalOption)); defaultConfig = new SampleConfig { LlamaCapacity = 23, ExternalOption = defaultOptions[0] }; var instance = new ConfigInstance <SampleConfig>(defaultConfig, identity.ClientId); mockConfigProvider.Setup(test => test.GetAsync(typeof(SampleConfig), identity)) .Returns(() => Task.FromResult <ConfigInstance>(instance)); target = new ConfigurationSetFactory(mockConfigProvider.Object, new TestOptionSetFactory(), registry); }
public ConfigurationSetService(IConfigurationSetFactory factory, ICachingStrategy cachingStrategy, ConfigurationModelRegistry registry) { this.factory = factory; this.cachingStrategy = cachingStrategy; this.registry = registry; }
public ConfigurationSetService(IConfigurationSetFactory factory, IMemoryCache memoryCache, ConfigurationSetRegistry registry) { this.factory = factory; this.memoryCache = memoryCache; this.registry = registry; }