Ejemplo n.º 1
0
        public void TransformingTrulyDetachedQueryToImmediateThrowsWhenNotProvidingNullStatelessSession()
        {
            var query = new DummyDetachedQuery();

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

            Assert.That(() => query.Immediate((IStatelessSession)null), Throws.InstanceOf <ArgumentNullException>());
        }
Ejemplo n.º 2
0
        public void TransformingTrulyDetachedQueryToImmediateThrowsWhenNotProvidingSession()
        {
            var query = new DummyDetachedQuery();

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

            Assert.That(() => query.Immediate(), Throws.InvalidOperationException);
        }
Ejemplo n.º 3
0
        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);
            }
        }