public void RelationshipsDictionary_GetAffected() { // arrange RelationshipsDictionary <Dummy> relationshipsDictionary = new RelationshipsDictionary <Dummy>(Relationships); // act var affectedThroughFirstToOne = relationshipsDictionary.GetAffected(d => d.FirstToOne).ToList(); var affectedThroughSecondToOne = relationshipsDictionary.GetAffected(d => d.SecondToOne).ToList(); var affectedThroughToMany = relationshipsDictionary.GetAffected(d => d.ToManies).ToList(); // assert affectedThroughFirstToOne.ForEach((entitiy) => Assert.Contains(entitiy, FirstToOnesEntities)); affectedThroughSecondToOne.ForEach((entitiy) => Assert.Contains(entitiy, SecondToOnesEntities)); affectedThroughToMany.ForEach((entitiy) => Assert.Contains(entitiy, ToManiesEntities)); }
public void RelationshipsDictionary_GetAffected() { // Arrange RelationshipsDictionary <Dummy> relationshipsDictionary = new RelationshipsDictionary <Dummy>(_relationships); // Act var affectedThroughFirstToOne = relationshipsDictionary.GetAffected(d => d.FirstToOne).ToList(); var affectedThroughSecondToOne = relationshipsDictionary.GetAffected(d => d.SecondToOne).ToList(); var affectedThroughToMany = relationshipsDictionary.GetAffected(d => d.ToManies).ToList(); // Assert affectedThroughFirstToOne.ForEach(resource => Assert.Contains(resource, _firstToOnesResources)); affectedThroughSecondToOne.ForEach(resource => Assert.Contains(resource, _secondToOnesResources)); affectedThroughToMany.ForEach(resource => Assert.Contains(resource, _toManiesResources)); }