Beispiel #1
0
        /// <summary>
        /// 保存测试
        /// </summary>
        public void SaveTest()
        {
            var config = new CatLib.Config.Config();

            config.AddLocator(new CodeConfigLocator());
            config.Set("123", "abc");
            config.Save();
        }
Beispiel #2
0
        /// <summary>
        /// 保存测试
        /// </summary>
        public void SaveTest()
        {
            var converent = new CatLib.Converters.Converters();

            converent.AddConverter(new StringStringConverter());
            var config = new CatLib.Config.Config(converent, new CodeConfigLocator());

            config.Set("123", "abc");
            config.Save();
        }
Beispiel #3
0
        public void ConfigUnitSettingTest()
        {
            var config = new CatLib.Config.Config();

            config.AddConverter(typeof(string), new StringStringConverter());
            config.AddLocator(new UnitySettingLocator());

            Assert.AreEqual(null, config.Get <string>("test"));
            config.Set("test", "test");
            Assert.AreEqual("test", config.Get <string>("test"));

            config.Set("test", "222");
            Assert.AreEqual("222", config.Get <string>("test"));

            config.Save();
        }
Beispiel #4
0
        public void ConfigTest()
        {
            var converent = new CatLib.Converters.Converters();

            converent.AddConverter(new StringStringConverter());
            var config = new CatLib.Config.Config(converent, new CodeConfigLocator());

            config.SetConverters(converent);
            config.SetLocator(new CodeConfigLocator());

            Assert.AreEqual(null, config.Get <string>("test"));
            config.Set("test", "test");
            Assert.AreEqual("test", config.Get <string>("test"));

            config.Set("test", "222");
            Assert.AreEqual("222", config.Get <string>("test"));

            config.Save();
        }