File tree Expand file tree Collapse file tree 2 files changed +52
-466
lines changed
commercetools.Sdk/Tests/commercetools.Sdk.Serialization.Tests Expand file tree Collapse file tree 2 files changed +52
-466
lines changed Original file line number Diff line number Diff line change @@ -360,6 +360,23 @@ public void DeserializeProductWithSetOfSetAttribute()
360
360
Assert . Equal ( "firstSet-1" , firstSet . FirstOrDefault ( ) ) ;
361
361
Assert . Equal ( "secondSet-1" , secondSet . FirstOrDefault ( ) ) ;
362
362
}
363
+ [ Fact ]
364
+ public void DeserializeProductWithSetOfSetOfSetAttribute ( )
365
+ {
366
+ var serializerService = this . serializationFixture . SerializerService ;
367
+ var productSerialized = File . ReadAllText ( "Resources/Attributes/SetOfSetAttribute.json" ) ;
368
+
369
+ var product = serializerService . Deserialize < Product > ( productSerialized ) ;
370
+ var attr = product . MasterData . Current . MasterVariant . Attributes [ 1 ] ;
371
+ Assert . NotNull ( attr ) ;
372
+ Assert . True ( attr . IsSetAttribute < AttributeSet < AttributeSet < string > > > ( ) ) ;
373
+ var setOfSetAttr = attr as Attribute < AttributeSet < AttributeSet < AttributeSet < string > > > > ;
374
+ Assert . NotNull ( setOfSetAttr ) ;
375
+ var set111 = setOfSetAttr . Value . First ( ) . First ( ) ;
376
+ var set121 = setOfSetAttr . Value . ElementAt ( 1 ) . First ( ) ;
377
+ Assert . Equal ( "set111-1" , set111 . FirstOrDefault ( ) ) ;
378
+ Assert . Equal ( "set121-1" , set121 . FirstOrDefault ( ) ) ;
379
+ }
363
380
364
381
}
365
382
}
You can’t perform that action at this time.
0 commit comments