public void ConfigurationNodeMergeDataCanGetPropertiesThatHaveBeenSet()
        {
            ConfigurationNodeMergeData mergeData = new ConfigurationNodeMergeData();
            mergeData.SetPropertyValue("propertyName", "propertyValue");
            string propertyValue = mergeData.GetPropertyValue("propertyName", typeof(string), null, null) as string;

            Assert.AreEqual("propertyValue", propertyValue);
        }
        public void ValueIsDeserializedOnGet()
        {
            ConfigurationNodeMergeData mergeData = new ConfigurationNodeMergeData();
            mergeData.SetPropertyValue("propertyName", new UnserializedPropertyValue("123"));

            int propertyValue = (int)mergeData.GetPropertyValue("propertyName", typeof(int), 0, null);

            Assert.AreEqual(123, propertyValue);
        }
Beispiel #3
0
        public void ConfigurationNodeMergeDataCanGetPropertiesThatHaveBeenSet()
        {
            ConfigurationNodeMergeData mergeData = new ConfigurationNodeMergeData();

            mergeData.SetPropertyValue("propertyName", "propertyValue");
            string propertyValue = mergeData.GetPropertyValue("propertyName", typeof(string), null, null) as string;

            Assert.AreEqual("propertyValue", propertyValue);
        }
        public void GettingValueAfterResetReturnsDefaultValue()
        {
            ConfigurationNodeMergeData mergeData = new ConfigurationNodeMergeData();
            mergeData.SetPropertyValue("propertyName", "propertyValue");
            mergeData.ResetPropertyValue("propertyName");

            string propertyValue = mergeData.GetPropertyValue("propertyName", typeof(string), "default", null) as string;

            Assert.AreEqual("default", propertyValue);
        }
Beispiel #5
0
        public void ValueIsDeserializedOnGet()
        {
            ConfigurationNodeMergeData mergeData = new ConfigurationNodeMergeData();

            mergeData.SetPropertyValue("propertyName", new UnserializedPropertyValue("123"));

            int propertyValue = (int)mergeData.GetPropertyValue("propertyName", typeof(int), 0, null);

            Assert.AreEqual(123, propertyValue);
        }
Beispiel #6
0
        public void GettingValueAfterResetReturnsDefaultValue()
        {
            ConfigurationNodeMergeData mergeData = new ConfigurationNodeMergeData();

            mergeData.SetPropertyValue("propertyName", "propertyValue");
            mergeData.ResetPropertyValue("propertyName");

            string propertyValue = mergeData.GetPropertyValue("propertyName", typeof(string), "default", null) as string;

            Assert.AreEqual("default", propertyValue);
        }