Unit test for NH-3589

https://nhibernate.jira.com/browse/NH-3589