Exemple #1
0
        public When_created_based_on_object_with_dictionary_property()
        {
            source = new ClassWithDictionaryProperty
            {
                Dictionary = new Dictionary <string, string>
                {
                    { "K1", "V1" },
                    { "K2", "V2" },
                    { "K3", "V3" },
                },
            };

            dynamicObject = new DynamicObject(source);
        }
        public When_created_based_on_object_with_dictionary_property()
        {
            source = new ClassWithDictionaryProperty
            {
                Dictionary = new Dictionary<string, string>
                {
                    { "K1", "V1" },
                    { "K2", "V2" },
                    { "K3", "V3" },
                }
            };

            dynamicObject = new DynamicObject(source);
        }
        public When_converting_to_object_with_dictionary_property()
        {
            dynamicObject = new DynamicObject(typeof(ClassWithDictionaryProperty))
            {
                {
                    "Dictionary",
                    new object[]
                    {
                        new KeyValuePair<string,string>("K1", "V1"),
                        new KeyValuePair<string,string>("K2", "V2"),
                        new KeyValuePair<string,string>("K3", "V3"),
                    }
                },
            };

            obj = new DynamicObjectMapper().Map(dynamicObject);

            objectWithDictionaryProperty = obj as ClassWithDictionaryProperty;
        }
Exemple #4
0
        public When_converting_to_object_with_dictionary_property()
        {
            dynamicObject = new DynamicObject(typeof(ClassWithDictionaryProperty))
            {
                Properties = new PropertySet
                {
                    {
                        "Dictionary",
                        new object[]
                        {
                            new KeyValuePair <string, string>("K1", "V1"),
                            new KeyValuePair <string, string>("K2", "V2"),
                            new KeyValuePair <string, string>("K3", "V3"),
                        }
                    },
                },
            };

            obj = new DynamicObjectMapper().Map(dynamicObject);

            objectWithDictionaryProperty = obj as ClassWithDictionaryProperty;
        }