示例#1
0
        public void SerializeNullableEnumWithNoValue()
        {
            var obj = new SerializeNullableEnumClass();

            var json = SimpleJson.SerializeObject(obj);

            Assert.AreEqual("{\"Value\":null}", json);
        }
示例#2
0
        public void SerializeNullableEnumWithValue()
        {
            var obj = new SerializeNullableEnumClass
            {
                Value = Values.Two
            };

            var json = SimpleJson.SerializeObject(obj);

            Assert.AreEqual("{\"Value\":\"Two\"}", json);
        }