protected override void Arrange() { base.Arrange(); var resourceHelper = new ResourceHelper <ConfigFileLocator>(); resourceHelper.DumpResourceFileToDisk(MainConfigurationFile); resourceHelper.DumpResourceFileToDisk(SatelliteConfigurationFile); var configurationSourceSection = ConfigurationSource.Sections.Where(s => s.ConfigurationType == typeof(ConfigurationSourceSection)).Single(); configurationSourceSection.Property("SelectedSource").Value = SatelliteSourceName; var builder = new ConfigurationSourceBuilder(); builder.ConfigureLogging() .LogToCategoryNamed("General") .SendTo.EventLog("EventLogListener") .ToLog("Application") .FormatWith(new FormatterBuilder().TextFormatterNamed("TextFormatter")); var section = builder.Get(LoggingSettings.SectionName); ConfigurationSource.AddSection(LoggingSettings.SectionName, section); }
protected override void Arrange() { base.Arrange(); var resourceHelper = new ResourceHelper<ConfigFileLocator>(); resourceHelper.DumpResourceFileToDisk(MainConfigurationFile); resourceHelper.DumpResourceFileToDisk(SatelliteConfigurationFile); var configurationSourceSection = ConfigurationSource.Sections.Where(s => s.ConfigurationType == typeof(ConfigurationSourceSection)).Single(); configurationSourceSection.Property("SelectedSource").Value = SatelliteSourceName; var builder = new ConfigurationSourceBuilder(); builder.ConfigureLogging() .LogToCategoryNamed("General") .SendTo.EventLog("EventLogListener") .ToLog("Application") .FormatWith(new FormatterBuilder().TextFormatterNamed("TextFormatter")); var section = builder.Get(LoggingSettings.SectionName); ConfigurationSource.AddSection(LoggingSettings.SectionName, section); }
public void Then_ReturnsNullIfCannotFind() { Assert.IsNull(ConfigurationSourceBuilder.Get("unknown section name")); }
public void Then_ReturnsNullIfCannotFindViaGeneric() { Assert.IsNull(ConfigurationSourceBuilder.Get <ConfigurationSourceSection>("unknown section name")); }
public void Then_CanRetrieveAddedSection() { Assert.AreSame(section, ConfigurationSourceBuilder.Get(ConfigurationSourceSection.SectionName)); }