public void Can_load_full_4_levels()
        {
            var provider    = new HierarchicalXmlSettingProvider(new XmlFilePathBuilder());
            var mockSetting = new MockAppSetting("TestApp");

            mockSetting.Initialize(provider);

            Assert.NotNull(mockSetting.SettingItem);
        }
        public void Can_load_full_4_levels_with_value()
        {
            var provider    = new HierarchicalXmlSettingProvider(new XmlFilePathBuilder());
            var mockSetting = new MockAppSetting("TestApp");

            mockSetting.Initialize(provider);

            Assert.True(mockSetting.SettingItem.HasChildren);
            Assert.Equal("Level4", mockSetting.SettingItem["level"].Value);
        }
Exemplo n.º 3
0
        public void Can_initialize_app_setting_with_xml_setting_provider()
        {
            var appSetting = new MockAppSetting("TestApplication");
            var provider   = GetProvider();

            Assert.Equal(false, appSetting.IsInitialized);

            appSetting.Initialize(provider);

            Assert.Equal(true, appSetting.IsInitialized);

            Assert.NotNull(appSetting.SettingItem);
        }