public void Bug() { var dq = new DetachedNamedQueryCrack(QueryName); ISession s = sessions.OpenSession(); dq.GetExecutableQuery(s); s.Close(); Assert.That(dq.Cacheable); Assert.That(dq.CacheRegion, Is.EqualTo("region")); Assert.That(dq.ReadOnly); Assert.That(dq.Timeout, Is.EqualTo(10)); Assert.That(dq.CacheMode, Is.EqualTo(CacheMode.Normal)); Assert.That(dq.FetchSize, Is.EqualTo(11)); Assert.That(dq.Comment, Is.EqualTo("the comment")); Assert.That(dq.FlushMode, Is.EqualTo(FlushMode.Auto)); }
public void Override() { var dq = new DetachedNamedQueryCrack(QueryName); dq.SetCacheable(false).SetCacheRegion("another region").SetReadOnly(false).SetTimeout(20).SetCacheMode( CacheMode.Refresh).SetFetchSize(22).SetComment("another comment").SetFlushMode(FlushMode.Commit); ISession s = sessions.OpenSession(); dq.GetExecutableQuery(s); s.Close(); Assert.That(!dq.Cacheable); Assert.That(dq.CacheRegion, Is.EqualTo("another region")); Assert.That(!dq.ReadOnly); Assert.That(dq.Timeout, Is.EqualTo(20)); Assert.That(dq.CacheMode, Is.EqualTo(CacheMode.Refresh)); Assert.That(dq.FetchSize, Is.EqualTo(22)); Assert.That(dq.Comment, Is.EqualTo("another comment")); Assert.That(dq.FlushMode, Is.EqualTo(FlushMode.Commit)); }