示例#1
0
        public void TestSerializeIntNone()
        {
            var x = new TestOptionInt();

            var s = JsonConvert.SerializeObject(x);

            s.Should().Be(@"{""A"":null}");
        }
示例#2
0
        public void TestSerializeInt()
        {
            var x = new TestOptionInt {
                A = 123
            };

            var s = JsonConvert.SerializeObject(x);

            s.Should().Be(@"{""A"":123}");
        }