Ejemplo n.º 1
0
        public void TestGetSource()
        {
            DynamicPropertyFactory.GetInstance();
            var defaultConfig = DynamicPropertyFactory.BackingConfigurationSource;

            Assert.IsTrue(defaultConfig is ConcurrentCompositeConfiguration);
            Assert.IsTrue(DynamicPropertyFactory.InitializedWithDefaultConfig);
        }
Ejemplo n.º 2
0
        public void TestPropertyCreation()
        {
            m_Config.StopLoading();
            const string newValue          = "newValue";
            var          callbackTriggered = false;
            EventHandler callback          = (s, a) => callbackTriggered = true;
            var          prop = DynamicPropertyFactory.GetInstance().GetStringProperty("foo.bar", "xyz", callback);

            Assert.AreEqual("xyz", prop.Value);
            m_Config.SetProperty("foo.bar", newValue);
            Assert.IsTrue(callbackTriggered);
            Assert.AreEqual(newValue, prop.Value);
            Assert.IsTrue(prop.Property.PropertyChangedHandlers.Any(h => h == callback));
        }