@@ -649,13 +649,23 @@ public void Can_Deserialize_Nested_Included_HasMany_Relationships()
649649 }" ;
650650
651651 // act
652- var result = deserializer . Deserialize < OneToManyDependent > ( contentString ) ;
652+ var result = deserializer . Deserialize < OneToManyIndependent > ( contentString ) ;
653653
654654 // assert
655655 Assert . NotNull ( result ) ;
656656 Assert . Equal ( 1 , result . Id ) ;
657657 Assert . NotNull ( result . ManyToManys ) ;
658658 Assert . Equal ( 2 , result . ManyToManys . Count ) ;
659+
660+ // TODO: not sure if this should be a thing that works?
661+ // could this cause cycles in the graph?
662+ // Assert.NotNull(result.ManyToManys[0].Dependent);
663+ // Assert.NotNull(result.ManyToManys[0].Independent);
664+ // Assert.NotNull(result.ManyToManys[1].Dependent);
665+ // Assert.NotNull(result.ManyToManys[1].Independent);
666+
667+ // Assert.Equal(result.ManyToManys[0].Dependent, result.ManyToManys[1].Dependent);
668+ // Assert.NotEqual(result.ManyToManys[0].Independent, result.ManyToManys[1].Independent);
659669 }
660670
661671 private JsonApiDeSerializer GetDeserializer ( ContextGraphBuilder contextGraphBuilder )
@@ -681,9 +691,9 @@ private JsonApiDeSerializer GetDeserializer(ContextGraphBuilder contextGraphBuil
681691 private class ManyToManyNested : Identifiable
682692 {
683693 [ Attr ( "name" ) ] public string Name { get ; set ; }
684- [ HasOne ( "dependent" ) ] public OneToManyDependent Dependents { get ; set ; }
694+ [ HasOne ( "dependent" ) ] public OneToManyDependent Dependent { get ; set ; }
685695 public int DependentId { get ; set ; }
686- [ HasOne ( "independent" ) ] public OneToManyIndependent Independents { get ; set ; }
696+ [ HasOne ( "independent" ) ] public OneToManyIndependent Independent { get ; set ; }
687697 public int InependentId { get ; set ; }
688698 }
689699
0 commit comments