void ValidateConfiguration(string configFile) { TestConfigurationSection section = GetSection(configFile); Assert.AreEqual(true, section.BoolValue); Assert.AreEqual(42, section.IntValue); }
protected override void Arrange() { cloner = new ConfigurationSectionCloner(); section = new TestConfigurationSection(); section.Custom.Name = "custom"; section.Custom.Attributes.Add("k1", "v1"); section.Custom.Attributes.Add("k2", "v2"); }
TestConfigurationSection GetSection(string configFile) { ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap(); fileMap.ExeConfigFilename = configFile; System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None); TestConfigurationSection section = (TestConfigurationSection)config.GetSection(TestConfigurationSection.SectionName); return(section); }
protected override void Act() { clonedSection = cloner.Clone(section) as TestConfigurationSection; }