public void TransformingTrulyDetachedQueryToStreamedThrowsWhenNotProvidingSession() { var query = new DummyDetachedQuery(); Assert.That(query.CriteriaFactory, Is.Null); Assert.That(() => query.Streamed(), Throws.InvalidOperationException); }
public void TransformingTrulyDetachedQueryToStreamedThrowsWhenProvidingNullStatelessSession() { var query = new DummyDetachedQuery(); Assert.That(query.CriteriaFactory, Is.Null); Assert.That(() => query.Streamed((IStatelessSession)null), Throws.InstanceOf <ArgumentNullException>()); }
public void TransformingTrulyDetachedQueryToStreamedDoesNotThrowWhenProvidingStatelessSession() { var query = new DummyDetachedQuery(); Assert.That(query.CriteriaFactory, Is.Null); IStreamedFlowQuery <UserEntity> streamed = null; Assert.That(() => streamed = query.Streamed(StatelessSession), Throws.Nothing); Assert.That(streamed, Is.Not.Null); var queryInfo = streamed as IFlowQuery; if (queryInfo == null) { Assert.Fail("queryInfo was null"); } else { Assert.That(queryInfo.CriteriaFactory, Is.Not.Null); } }