コード例 #1
0
        public void TransformingTrulyDetachedQueryToStreamedThrowsWhenNotProvidingSession()
        {
            var query = new DummyDetachedQuery();

            Assert.That(query.CriteriaFactory, Is.Null);

            Assert.That(() => query.Streamed(), Throws.InvalidOperationException);
        }
コード例 #2
0
        public void TransformingTrulyDetachedQueryToStreamedThrowsWhenProvidingNullStatelessSession()
        {
            var query = new DummyDetachedQuery();

            Assert.That(query.CriteriaFactory, Is.Null);

            Assert.That(() => query.Streamed((IStatelessSession)null), Throws.InstanceOf <ArgumentNullException>());
        }
コード例 #3
0
        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);
            }
        }