public void TestAddStorage_OverriddenSections() { MockConfigurationInitializer_SingleRuntimeStorage1_MOD_B initializer_1 = new MockConfigurationInitializer_SingleRuntimeStorage1_MOD_B(source); MockConfigurationInitializer_SingleRuntimeStorage1_MOD_A initializer_2 = new MockConfigurationInitializer_SingleRuntimeStorage1_MOD_A(source); MockConfigurationInitializer_SingleRuntimeStorage1 initializer_3 = new MockConfigurationInitializer_SingleRuntimeStorage1(source); ISettings settings = source.GetSection(initializer_3.Section1); StorageSettings section = settings as StorageSettings; Assert.IsNotNull(section?.Child?.Child); //ConfigurationSection root = section; //ConfigurationSection child1 = root.Child; //ConfigurationSection child2 = root.Child; //var storage = initializer_1.Storage1.Storage; //foreach (string sectionName in storage.Sections) //{ // foreach (string key in storage.GetKeys(sectionName)) // { // } //} //TryRead(initializer_1.Section1 }
public void TestGetDefaultSection_EmptyButExisting() { var initializer = new MockConfigurationInitializer_SingleRuntimeStorage1(source); var configuration = new MockConfiguration_Empty_SectionAttributeForDefaultSection_Section1(source); var keys = initializer.Storage1.Storage.GetKeys(configuration.DefaultSectionName).ToList(); var accessedKeys = configuration.DefaultSectionPublic.Keys.ToList(); CollectionAssert.IsSubsetOf(accessedKeys, keys); }
public void TestHasSection_SingleRuntimeStorage() { MockConfigurationInitializer_SingleRuntimeStorage1 initializer = new MockConfigurationInitializer_SingleRuntimeStorage1(source); Assert.IsTrue(source.HasSection(initializer.Section1)); }