I am using NHibernate to retrieve an object from the database. As part of a test, I want to check the private fields of the returned object are as expected.
The public properties responsible for accessing the fields return the correct values, however when the private fields are accessed directly using reflection, they are empty.
I have tried calling NHibernateUtil.Initialize on the object, but this doesn't seem to make any difference.
If I set lazy=”false” on the class that I am loading, this fixes the problem, but I would rather not do that.
Does anybody have any idea of how this might be done?
Thanks.
|