Is there any way to write an integration test to test that the FetchMode.Eager works correctly? I want to verify that it's not going to the database when I retrieve MySubObject.
The code:
public MyObject GetEager(string name)
{
return Session
.CreateCriteria(typeof(MyObject))
.SetFetchMode("MySubObject", FetchMode.Eager)
.Add(Restrictions.Eq("Name", name))
.UniqueResult<MyObject>();
}