Load() private méthode

Loads all collection classes.
private Load ( ) : void
Résultat void
Exemple #1
0
        public void LoadReader()
        {
            XmlDocument doc = NiniDoc();

            AddSection(doc, "Pets");
            AddKey(doc, "Pets", "cat", "muffy");
            AddKey(doc, "Pets", "dog", "rover");
            AddKey(doc, "Pets", "bird", "tweety");

            DotNetConfigSource source =
                new DotNetConfigSource(DocumentToReader(doc));

            IConfig config = source.Configs["Pets"];

            Assert.AreEqual(3, config.GetKeys().Length);
            Assert.AreEqual("rover", config.Get("dog"));

            config.Set("dog", "new name");
            config.Remove("bird");

            source.Load(DocumentToReader(doc));

            config = source.Configs["Pets"];
            Assert.AreEqual(3, config.GetKeys().Length);
            Assert.AreEqual("rover", config.Get("dog"));
        }
        public void LoadReader() {
            XmlDocument doc = NiniDoc();
            AddSection(doc, "Pets");
            AddKey(doc, "Pets", "cat", "muffy");
            AddKey(doc, "Pets", "dog", "rover");
            AddKey(doc, "Pets", "bird", "tweety");

            DotNetConfigSource source =
                new DotNetConfigSource(DocumentToReader(doc));

            IConfig config = source.Configs["Pets"];
            Assert.AreEqual(3, config.GetKeys().Length);
            Assert.AreEqual("rover", config.Get("dog"));

            config.Set("dog", "new name");
            config.Remove("bird");

            source.Load(DocumentToReader(doc));

            config = source.Configs["Pets"];
            Assert.AreEqual(3, config.GetKeys().Length);
            Assert.AreEqual("rover", config.Get("dog"));
        }