示例#1
0
        public void Dump()
        {
            var item     = new Dummy(1);
            var settings = new JsonSerializerSettings {
                Formatting = Formatting.Indented
            };
            var json = JsonSerializerAssert.ToJson(item, settings);

            Console.Write(json);
        }
示例#2
0
        public void ToJson()
        {
            var dummy = new Dummy {
                Value = 2
            };
            var json = JsonSerializerAssert.ToJson(dummy);

            Console.Write(json);
            var expected = "{\"Value\":2}";

            Assert.AreEqual(expected, json);
        }