Пример #1
0
        public void TransformingTrulyDetachedQueryToDelayedThrowsWhenNotProvidingNullStatelessSession()
        {
            var query = new DummyDetachedQuery();

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

            Assert.That(() => query.Delayed((IStatelessSession)null), Throws.InstanceOf <ArgumentNullException>());
        }
Пример #2
0
        public void TransformingTrulyDetachedQueryToDelayedThrowsWhenNotProvidingSession()
        {
            var query = new DummyDetachedQuery();

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

            Assert.That(() => query.Delayed(), Throws.InvalidOperationException);
        }
Пример #3
0
        public void TransformingTrulyDetachedQueryToDelayedDoesNotThrowWhenProvidingStatelessSession()
        {
            var query = new DummyDetachedQuery();

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

            IDelayedFlowQuery <UserEntity> delayed = null;

            Assert.That(() => delayed = query.Delayed(StatelessSession), Throws.Nothing);

            Assert.That(delayed, Is.Not.Null);

            var queryInfo = delayed as IFlowQuery;

            if (queryInfo == null)
            {
                Assert.Fail("queryInfo was null");
            }
            else
            {
                Assert.That(queryInfo.CriteriaFactory, Is.Not.Null);
            }
        }