public void TransformingTrulyDetachedQueryToImmediateThrowsWhenNotProvidingNullStatelessSession() { var query = new DummyDetachedQuery(); Assert.That(query.CriteriaFactory, Is.Null); Assert.That(() => query.Immediate((IStatelessSession)null), Throws.InstanceOf <ArgumentNullException>()); }
public void TransformingTrulyDetachedQueryToImmediateThrowsWhenNotProvidingSession() { var query = new DummyDetachedQuery(); Assert.That(query.CriteriaFactory, Is.Null); Assert.That(() => query.Immediate(), Throws.InvalidOperationException); }
public void TransformingTrulyDetachedQueryToImmediateDoesNotThrowWhenProvidingStatelessSession() { var query = new DummyDetachedQuery(); Assert.That(query.CriteriaFactory, Is.Null); IImmediateFlowQuery <UserEntity> immediate = null; Assert.That(() => immediate = query.Immediate(StatelessSession), Throws.Nothing); Assert.That(immediate, Is.Not.Null); var queryInfo = immediate as IFlowQuery; if (queryInfo == null) { Assert.Fail("queryInfo was null"); } else { Assert.That(queryInfo.CriteriaFactory, Is.Not.Null); } }