예제 #1
0
        public void DumpStringStringDictionaryTest()
        {
            var jsonData = new Dictionary <string, string>()
            {
                { "key", "value" }
            };
            var jsonSer    = new NewtonsoftJsonSerializer <string, string>();
            var jsonString = jsonSer.Dump(jsonData);

            Assert.AreEqual("{\"key\":\"value\"}", jsonString);
        }
예제 #2
0
        public void DumpStringDynamicDictionaryTest()
        {
            var jsonData = new Dictionary <string, dynamic>()
            {
                { "key", new List <int>()
                  {
                      1, 2, 3
                  } }
            };
            var jsonSer    = new NewtonsoftJsonSerializer <string, dynamic>();
            var jsonString = jsonSer.Dump(jsonData);

            Assert.AreEqual("{\"key\":[1,2,3]}", jsonString);
        }