Is there a way to have NHibernate’s SchemaExport generate check constraints defined in its .hbm.xml files? Or is that not really part of its domain?
Either way, how can I, in combination with NHibernate’s SchemaExport, add check constraints to the schema it generates so as to run my unit tests properly.
Yes. When you define your property mapping, you can define a column and identify a constraint via the check attribute.
See Section 19.1 of the NHibernate documentation for more details.