예제 #1
0
        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
        }
예제 #2
0
        public void TestHasSection_OverriddenSections()
        {
            var initializer_1 = new MockConfigurationInitializer_SingleRuntimeStorage1_MOD_A(source);

            Assert.IsTrue(source.HasSection(initializer_1.Section1));

            var initializer_2 = new MockConfigurationInitializer_MultipleRuntimeStorages(source);

            Assert.IsTrue(source.HasSection(initializer_1.Section1));

            Assert.IsTrue(source.HasSection(initializer_2.Section1));
            Assert.IsTrue(source.HasSection(initializer_2.Section2));
        }