Exemplo n.º 1
0
        public static void WriteClassWithObjectImmutableTypes()
        {
            string json;

            {
                TestClassWithObjectImmutableTypes obj = new TestClassWithObjectImmutableTypes();
                obj.Initialize();
                obj.Verify();
                json = JsonSerializer.ToString(obj);
            }

            {
                TestClassWithObjectImmutableTypes obj = JsonSerializer.Parse <TestClassWithObjectImmutableTypes>(json);
                obj.Verify();
            }

            {
                TestClassWithObjectImmutableTypes obj = JsonSerializer.Parse <TestClassWithObjectImmutableTypes>(TestClassWithObjectImmutableTypes.s_data);
                obj.Verify();
            }
        }
Exemplo n.º 2
0
        public static void ReadClassWithObjectImmutableTypes()
        {
            TestClassWithObjectImmutableTypes obj = JsonSerializer.Parse <TestClassWithObjectImmutableTypes>(TestClassWithObjectImmutableTypes.s_data);

            obj.Verify();
        }