コード例 #1
0
ファイル: Array.WriteTests.cs プロジェクト: jm771/corefx
        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();
            }
        }
コード例 #2
0
ファイル: Array.ReadTests.cs プロジェクト: ze1tgeist/corefx
        public static void ReadClassWithObjectImmutableTypes()
        {
            TestClassWithObjectImmutableTypes obj = JsonSerializer.Parse <TestClassWithObjectImmutableTypes>(TestClassWithObjectImmutableTypes.s_data);

            obj.Verify();
        }