@@ -649,13 +649,23 @@ public void Can_Deserialize_Nested_Included_HasMany_Relationships()
649
649
}" ;
650
650
651
651
// act
652
- var result = deserializer . Deserialize < OneToManyDependent > ( contentString ) ;
652
+ var result = deserializer . Deserialize < OneToManyIndependent > ( contentString ) ;
653
653
654
654
// assert
655
655
Assert . NotNull ( result ) ;
656
656
Assert . Equal ( 1 , result . Id ) ;
657
657
Assert . NotNull ( result . ManyToManys ) ;
658
658
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);
659
669
}
660
670
661
671
private JsonApiDeSerializer GetDeserializer ( ContextGraphBuilder contextGraphBuilder )
@@ -681,9 +691,9 @@ private JsonApiDeSerializer GetDeserializer(ContextGraphBuilder contextGraphBuil
681
691
private class ManyToManyNested : Identifiable
682
692
{
683
693
[ Attr ( "name" ) ] public string Name { get ; set ; }
684
- [ HasOne ( "dependent" ) ] public OneToManyDependent Dependents { get ; set ; }
694
+ [ HasOne ( "dependent" ) ] public OneToManyDependent Dependent { get ; set ; }
685
695
public int DependentId { get ; set ; }
686
- [ HasOne ( "independent" ) ] public OneToManyIndependent Independents { get ; set ; }
696
+ [ HasOne ( "independent" ) ] public OneToManyIndependent Independent { get ; set ; }
687
697
public int InependentId { get ; set ; }
688
698
}
689
699
0 commit comments