I'm using NHibernate for data access. I'm working on writing some tests for my data access layer and have a scenario where I'm selecting records within a specific date range.
In test, I generate test data by just selecting random dates within a range and then I try to select records with dates within a subset o that range. For instance, I generate records with dates between yesterday and tomorrow, then I select only records that have a date of today.
The problem is that these dates are usually generated by the DB -- they are set to generated="insert"
basically. Is there a way to set up NHibernate such that it uses the DB-generated a date when one isn't supplied by the user?
If not, anyone have a strategy for mitigating this during testing?