title: Unit Testing & Fake Repository implementation with cascading CRUD operations
body: <p>i'm having trouble writing integration tests which use a fake repository,</p>
  
  <p>For example : Suppose I have a classroom entity, which aggregates students...</p>
  
  <pre><code>var classroom = new Classroom();
  classroom.Students.Add(new Student("Adam"));
  
  _fakeRepository.Save(classroom);
  
  _fakeRepostiory.GetAll&lt;Student&gt;().Where((student) =&gt; student.Name == "Adam")); 
  // This query will return null...
  </code></pre>
  
  <p>When using my real implementation for repository (NHibernate based), the above code works (because the save operation would cascade to the student added at the previous line),</p>
  
  <p>Do you know of any fake repository implementation which support this behaviour?
  Ideas on how to implement one myself?</p>
  
  <p>Or do you have any other suggestions which could help me avoid this issue?</p>
  
  <p>Thanks in advance,
  Erik.</p>