public void ShouldBeAbleToLoadFromProviders() { var section = new ConfigSectionGlimpse(); var configProvider = new Mock <IConfigProvider>(); configProvider.Setup(x => x.GetSection <ConfigSectionGlimpse>("")).Returns(section); var settings = new TestSettings(); settings.LoggerProvider = new SystemLoggerProviderNull(); var configProcessor = new ConfigProcessor(configProvider.Object); configProcessor.Process(settings); }
public void ShouldBeAbleToFullyLoadConfig() { var section = new ConfigSectionGlimpse(); section.UseOfflineData = true; var logging = new ConfigElementLogging(); section.Logging = logging; logging.Enabled = true; logging.LogEverything = true; logging.LoggingPath = "Test"; var services = new ConfigElementServices(); section.Services = services; services.MinTriggerInterval = 10; var configProvider = new Mock <IConfigProvider>(); configProvider.Setup(x => x.GetSection <ConfigSectionGlimpse>("")).Returns(section); var settings = new TestSettings(); settings.LoggerProvider = new SystemLoggerProviderNull(); var configProcessor = new ConfigProcessor(configProvider.Object); configProcessor.Process(settings); Assert.True(settings.UseOfflineData); Assert.True(settings.LoggingEnabled); Assert.True(settings.LogEverything); Assert.Equal("Test", settings.LoggingPath); Assert.Equal(10, settings.MinServiceTriggerInterval); }