Unit testing a two way EF relationship
问题 I'm doing a small practice project to improve my unit testing skills. I'm using Entity Framework Code First. I'm using a FakeDBSet, which works well for simple lists of entities. When entity trees are returned things aren't so nice. In particular two way relationships aren't maintained as this is part of the Entity Framework magic. I have two classes: public class Book { public virtual ICollection<Review> Reviews {get; set;} } public class Review { public virtual Book Book { get; set;} } If I