@@ -124,7 +124,7 @@ public void SerializeTest()
124
124
. RegisterSubtype ( typeof ( Dog ) , AnimalType . Dog )
125
125
. Build ( ) ) ;
126
126
127
- var json = "{\" catLives \" :6 ,\" age \" :11 ,\" type \" :2 }" ;
127
+ var json = "{\" type \" :2 ,\" catLives \" :6 ,\" age \" :11 }" ;
128
128
129
129
var result = JsonConvert . SerializeObject ( new Cat { Age = 11 , Lives = 6 } ) ;
130
130
@@ -144,7 +144,7 @@ public void RegisterWithGenericTypes()
144
144
. RegisterSubtype < Dog > ( AnimalType . Dog )
145
145
. Build ( ) ) ;
146
146
147
- var json = "{\" catLives \" :6 ,\" age \" :11 ,\" type \" :2 }" ;
147
+ var json = "{\" type \" :2 ,\" catLives \" :6 ,\" age \" :11 }" ;
148
148
149
149
var result = JsonConvert . SerializeObject ( new Cat { Age = 11 , Lives = 6 } ) ;
150
150
@@ -506,10 +506,9 @@ public void TestIfNestedObjectIsSerialized2()
506
506
SubExpressionB = new ConstantExpression2 { Value = "B" }
507
507
} ) ;
508
508
509
- Assert . AreEqual ( "{" +
510
- "\" SubExpressionA\" :{\" Value\" :\" A\" ,\" Type\" :\" Constant\" }," +
511
- "\" SubExpressionB\" :{\" Value\" :\" B\" ,\" Type\" :\" Constant\" }" +
512
- ",\" Type\" :\" Binary\" }" , target ) ;
509
+ Assert . AreEqual ( "{\" Type\" :\" Binary\" ," +
510
+ "\" SubExpressionA\" :{\" Type\" :\" Constant\" ,\" Value\" :\" A\" }," +
511
+ "\" SubExpressionB\" :{\" Type\" :\" Constant\" ,\" Value\" :\" B\" }}" , target ) ;
513
512
}
514
513
515
514
[ Test ]
@@ -532,10 +531,10 @@ public void TestNestedObjectInBothWay()
532
531
SubExpressionB = new ManyOrExpression2 { OrExpr = new List < IExpression2 > { new ConstantExpression2 { Value = "A" } , new ManyOrExpression2 { OrExpr = new List < IExpression2 > { new ConstantExpression2 { Value = "A" } , new ConstantExpression2 { Value = "B" } } } } }
533
532
} ) ;
534
533
535
- var json = "{" +
536
- "\" SubExpressionA\" :{\" OrExpr \" :[{ \" Value \" : \" A \" , \" Type\" :\" Constant\" },{ \" Value\" :\" B \" , \" Type\" :\" Constant\" }] ,\" Type \" :\" ManyOr \" }," +
537
- "\" SubExpressionB\" :{\" OrExpr \" :[{ \" Value \" : \" A \" , \" Type\" :\" Constant\" },{ \" OrExpr \" :[{ \" Value\" :\" A\" , \" Type\" :\" Constant \" }, {\" Value \" :\" B \" ,\" Type \" :\" Constant \" }], \" Type\" :\" ManyOr \" }] ,\" Type \" :\" ManyOr \" }" +
538
- ", \" Type \" : \" Binary \" }" ;
534
+ var json = "{\" Type \" : \" Binary \" , " +
535
+ "\" SubExpressionA\" :{\" Type \" :\" ManyOr \" , \" OrExpr \" :[{ \" Type\" :\" Constant\" , \" Value\" :\" A \" },{ \" Type\" :\" Constant\" ,\" Value \" :\" B \" }] }," +
536
+ "\" SubExpressionB\" :{\" Type \" :\" ManyOr \" , \" OrExpr \" :[{ \" Type\" :\" Constant\" , \" Value\" :\" A\" },{ \" Type\" :\" ManyOr \" , \" OrExpr \" :[ {\" Type \" :\" Constant \" ,\" Value \" :\" A \" },{ \" Type\" :\" Constant \" ,\" Value \" :\" B \" }]}] }" +
537
+ "}" ;
539
538
Assert . AreEqual ( json , target ) ;
540
539
541
540
@@ -566,10 +565,10 @@ public void TestNestedObjectInBothWayParallel()
566
565
SubExpressionB = new ManyOrExpression2 { OrExpr = new List < IExpression2 > { new ConstantExpression2 { Value = "A" } , new ManyOrExpression2 { OrExpr = new List < IExpression2 > { new ConstantExpression2 { Value = "A" } , new ConstantExpression2 { Value = "B" } } } } }
567
566
} ) ;
568
567
569
- var json = "{" +
570
- "\" SubExpressionA\" :{\" OrExpr \" :[{ \" Value \" : \" A \" , \" Type\" :\" Constant\" },{ \" Value\" :\" B \" , \" Type\" :\" Constant\" }] ,\" Type \" :\" ManyOr \" }," +
571
- "\" SubExpressionB\" :{\" OrExpr \" :[{ \" Value \" : \" A \" , \" Type\" :\" Constant\" },{ \" OrExpr \" :[{ \" Value\" :\" A\" , \" Type\" :\" Constant \" }, {\" Value \" :\" B \" ,\" Type \" :\" Constant \" }], \" Type\" :\" ManyOr \" }] ,\" Type \" :\" ManyOr \" }" +
572
- ", \" Type \" : \" Binary \" }" ;
568
+ var json = "{\" Type \" : \" Binary \" , " +
569
+ "\" SubExpressionA\" :{\" Type \" :\" ManyOr \" , \" OrExpr \" :[{ \" Type\" :\" Constant\" , \" Value\" :\" A \" },{ \" Type\" :\" Constant\" ,\" Value \" :\" B \" }] }," +
570
+ "\" SubExpressionB\" :{\" Type \" :\" ManyOr \" , \" OrExpr \" :[{ \" Type\" :\" Constant\" , \" Value\" :\" A\" },{ \" Type\" :\" ManyOr \" , \" OrExpr \" :[ {\" Type \" :\" Constant \" ,\" Value \" :\" A \" },{ \" Type\" :\" Constant \" ,\" Value \" :\" B \" }]}] }" +
571
+ "}" ;
573
572
Assert . AreEqual ( json , target ) ;
574
573
575
574
0 commit comments