Пример #1
0
        public void MakeArrayFromValues_GoodValues_MakesArray()
        {
            var list = new List <string>();

            list.Add(JSONUtils.MakeKeyValuePair("corvette", "car"));
            list.Add(JSONUtils.MakeKeyValuePair("banana", "fruit"));
            list.Add(JSONUtils.MakeKeyValuePair("spot", "dog"));

            Assert.AreEqual("\"stuff\":{\"0\":{\"corvette\":\"car\"},\"1\":{\"banana\":\"fruit\"},\"2\":{\"spot\":\"dog\"}}",
                            JSONUtils.MakeArrayFromValues("stuff", list));
        }