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

            var json = SimpleJson.SerializeObject(obj);

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

            var json = SimpleJson.SerializeObject(obj);

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