The context is set up for lazy loading and seems that everything is working properly but:
public void Test_Lazy_Loading() {
using (var context = new MyDbContext()) {
var student = context.Students.First();
var loaded = context.Entry(student).Collection(e => e.Classes).IsLoaded; // returns true
Assert.IsFalse(loaded); // fails
}
}
Does this test mean that CLasses
is eager loaded?
What is the best way to test that lazy loading is working?