Example #1
0
        public void TestJilCollectionSerialization()
        {
            var collectionObj = new CollectionTesting()
            {
                ArrayListCollection = new ArrayList()
                {
                    "Object1", "Object2"
                },
                CustomListCollection = new CustomListTest <string>()
                {
                    "Item1", "Item2"
                },
                DictionaryCollection = new Dictionary <string, string>()
                {
                },
                ListCollection = new List <string>()
                {
                    "Item 1", "Item 2"
                },
                ObjectArrayCollection = new [] { new CollectionTesting() }
            };

            collectionObj.DictionaryCollection.Add("Key 1", "Value 1");
            collectionObj.DictionaryCollection.Add("Key 2", "Value 2");

            string res = Jil.JSON.Serialize(collectionObj);
        }
Example #2
0
        public void TestJilCollectionSerialization()
        {
            var collectionObj = new CollectionTesting()
            {
                ArrayListCollection = new ArrayList() {"Object1", "Object2"},
                CustomListCollection = new CustomListTest<string>() {"Item1", "Item2"},
                DictionaryCollection = new Dictionary<string, string>() {},
                ListCollection = new List<string>() { "Item 1", "Item 2" },
                ObjectArrayCollection = new [] { new CollectionTesting() }
            };

            collectionObj.DictionaryCollection.Add("Key 1", "Value 1");
            collectionObj.DictionaryCollection.Add("Key 2", "Value 2");

            string res = Jil.JSON.Serialize(collectionObj);
        }