Ejemplo n.º 1
0
        public void ReadonlyTest()
        {
            var d = new readonlyclass();
            var s = JSON.ToJSON(d, new JSONParameters {
                ShowReadOnlyProperties = false
            });
            var o = JSON.ToObject(s);

            Console.WriteLine(s);
            var s2 = JSON.ToJSON(d, new JSONParameters {
                ShowReadOnlyProperties = true
            });
            var o2 = JSON.ToObject(s2);

            Console.WriteLine(s2);
            Assert.AreNotEqual(s, s2);
        }
Ejemplo n.º 2
0
        public void ReadonlyTest()
        {
            var d = new readonlyclass();
            var s = Json.ToJson(d, new SerializationManager {
                SerializeReadOnlyProperties = false
            });
            var o = Json.ToObject(s);

            Console.WriteLine(s);
            var s2 = Json.ToJson(d, new SerializationManager {
                SerializeReadOnlyProperties = true
            });
            var o2 = Json.ToObject(s2);

            Console.WriteLine(s2);
            Assert.AreNotEqual(s, s2);
        }