@@ -562,29 +562,31 @@ public static void DCS_CollectionGenericMembers()
562
562
Assert . True ( y . RO1 . Count == 1 , getCheckFailureMsg ( "RO1" ) ) ;
563
563
Assert . True ( y . RO2 . Count == 1 , getCheckFailureMsg ( "RO2" ) ) ;
564
564
565
-
566
-
567
-
568
565
foreach ( var item in x . F1 )
569
566
{
570
567
Assert . True ( y . F1 . Contains ( item ) , getCheckFailureMsg ( "F1" ) ) ;
571
568
}
569
+
572
570
foreach ( var item in x . F2 )
573
571
{
574
572
Assert . True ( y . F2 . Contains ( item ) , getCheckFailureMsg ( "F2" ) ) ;
575
573
}
574
+
576
575
foreach ( var item in x . P1 )
577
576
{
578
577
Assert . True ( y . P1 . Contains ( item ) , getCheckFailureMsg ( "P1" ) ) ;
579
578
}
579
+
580
580
foreach ( var item in x . P2 )
581
581
{
582
582
Assert . True ( y . P2 . Contains ( item ) , getCheckFailureMsg ( "P2" ) ) ;
583
583
}
584
+
584
585
foreach ( var item in x . RO1 )
585
586
{
586
587
Assert . True ( y . RO1 . Contains ( item ) , getCheckFailureMsg ( "RO1" ) ) ;
587
588
}
589
+
588
590
foreach ( var item in x . RO2 )
589
591
{
590
592
Assert . True ( y . RO2 . Contains ( item ) , getCheckFailureMsg ( "RO2" ) ) ;
@@ -1171,7 +1173,6 @@ public static void DCS_SerializeClassThatImplementsInteface()
1171
1173
ClassImplementsInterface value = new ClassImplementsInterface ( ) { ClassID = "ClassID" , DisplayName = "DisplayName" , Id = "Id" , IsLoaded = true } ;
1172
1174
var actual = SerializeAndDeserialize < ClassImplementsInterface > ( value , "<ClassImplementsInterface xmlns=\" http://schemas.datacontract.org/2004/07/SerializationTypes\" xmlns:i=\" http://www.w3.org/2001/XMLSchema-instance\" ><DisplayName>DisplayName</DisplayName><Id>Id</Id></ClassImplementsInterface>" ) ;
1173
1175
1174
-
1175
1176
Assert . StrictEqual ( value . DisplayName , actual . DisplayName ) ;
1176
1177
Assert . StrictEqual ( value . Id , actual . Id ) ;
1177
1178
}
@@ -1246,6 +1247,7 @@ public int GetPrivatePropertyValue()
1246
1247
return PrivateProperty ;
1247
1248
}
1248
1249
}
1250
+
1249
1251
#endregion
1250
1252
1251
1253
[ Fact ]
@@ -1441,13 +1443,30 @@ private static void DCS_Tuple8()
1441
1443
1442
1444
[ Fact ]
1443
1445
public static void DCS_GenericQueue ( )
1446
+ {
1447
+ var expectedFormat = @"<QueueOfint xmlns=""http://schemas.datacontract.org/2004/07/System.Collections.Generic"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""><_array xmlns:a=""http://schemas.microsoft.com/2003/10/Serialization/Arrays""><a:int>1</a:int><a:int>0</a:int><a:int>0</a:int><a:int>0</a:int></_array><_head>0</_head><_size>1</_size>{0}<_tail>1</_tail><_version>2</_version></QueueOfint>" ;
1448
+ #if DESKTOP
1449
+ var expectedOnDesktop = string . Format ( expectedFormat , string . Empty ) ;
1450
+ DCS_GenericQueueHelper ( expectedOnDesktop , expectedOnDesktop ) ;
1451
+ #else
1452
+ DCS_GenericQueueHelper ( string . Format ( expectedFormat , @"<_syncRoot i:nil=""true"" />" ) , string . Format ( expectedFormat , @"<_syncRoot/>" ) ) ;
1453
+ #endif
1454
+ }
1455
+
1456
+ private static void DCS_GenericQueueHelper ( string expectedWithUninitializedSyncRoot , string expectedWithInitializedSyncRoot )
1444
1457
{
1445
1458
Queue < int > value = new Queue < int > ( ) ;
1446
1459
value . Enqueue ( 1 ) ;
1447
- var deserializedValue = SerializeAndDeserialize < Queue < int > > ( value , "<QueueOfint xmlns= \" http://schemas.datacontract.org/2004/07/System.Collections.Generic \" xmlns:i= \" http://www.w3.org/2001/XMLSchema-instance \" ><_array xmlns:a= \" http://schemas.microsoft.com/2003/10/Serialization/Arrays \" ><a:int>1</a:int><a:int>0</a:int><a:int>0</a:int><a:int>0</a:int></_array><_head>0</_head><_size>1</_size><_tail>1</_tail><_version>2</_version></QueueOfint>" ) ;
1460
+ var deserializedValue = SerializeAndDeserialize < Queue < int > > ( value , expectedWithUninitializedSyncRoot ) ;
1448
1461
var a1 = value . ToArray ( ) ;
1449
1462
var a2 = deserializedValue . ToArray ( ) ;
1450
1463
Assert . StrictEqual ( a1 . Length , a2 . Length ) ;
1464
+ Assert . StrictEqual ( a1 [ 0 ] , a2 [ 0 ] ) ;
1465
+ object syncRoot = ( ( ICollection ) value ) . SyncRoot ;
1466
+ deserializedValue = SerializeAndDeserialize < Queue < int > > ( value , expectedWithInitializedSyncRoot ) ;
1467
+ a1 = value . ToArray ( ) ;
1468
+ a2 = deserializedValue . ToArray ( ) ;
1469
+ Assert . StrictEqual ( a1 . Length , a2 . Length ) ;
1451
1470
Assert . StrictEqual ( a1 [ 0 ] , a2 [ 0 ] ) ;
1452
1471
}
1453
1472
0 commit comments