コード例 #1
0
 public void TestAsFileBased()
 {
     DynamicStringProperty prop = new DynamicStringProperty("props1", null);
     DynamicStringProperty prop2 = new DynamicStringProperty("props2", null);
     DynamicIntProperty prop3 = new DynamicIntProperty("props3", 0);
     Thread.Sleep(1000);
     Assert.AreEqual("xyz", prop.Value);
     Assert.AreEqual("abc", prop2.Value);
     Assert.AreEqual(0, prop3.Value);
     ModifyConfigFile();
     // Waiting for reload
     Thread.Sleep(2000);
     Assert.IsNull(prop.Value);
     Assert.AreEqual("456", prop2.Value);
     Assert.AreEqual(123, prop3.Value);
     m_Config.StopLoading();
     Thread.Sleep(2000);
     m_Config.SetProperty("props2", "000");
     Assert.AreEqual("000", prop2.Value);
 }
コード例 #2
0
        public void TestAsFileBased()
        {
            DynamicStringProperty prop  = new DynamicStringProperty("props1", null);
            DynamicStringProperty prop2 = new DynamicStringProperty("props2", null);
            DynamicIntProperty    prop3 = new DynamicIntProperty("props3", 0);

            Thread.Sleep(1000);
            Assert.AreEqual("xyz", prop.Value);
            Assert.AreEqual("abc", prop2.Value);
            Assert.AreEqual(0, prop3.Value);
            ModifyConfigFile();
            // Waiting for reload
            Thread.Sleep(2000);
            Assert.IsNull(prop.Value);
            Assert.AreEqual("456", prop2.Value);
            Assert.AreEqual(123, prop3.Value);
            m_Config.StopLoading();
            Thread.Sleep(2000);
            m_Config.SetProperty("props2", "000");
            Assert.AreEqual("000", prop2.Value);
        }