public void CanCreateStatelessStreamedFlowQuery()
        {
            Assert.That(() => StatelessSession.StreamedFlowQuery <UserEntity>(), Throws.Nothing);

            IStreamedFlowQuery <UserEntity> query = StatelessSession.StreamedFlowQuery <UserEntity>();

            Assert.That(query != null);
        }
        public void CanCreateStreamedFlowQueryWithOptions()
        {
            Assert.That(() => Session.StreamedFlowQuery <UserEntity>(new FlowQueryOptions()), Throws.Nothing);

            IStreamedFlowQuery <UserEntity> query =
                Session.StreamedFlowQuery <UserEntity>(new FlowQueryOptions());

            Assert.That(query != null);
        }
示例#3
0
        public void CanMorphImmediateToStreamed()
        {
            IImmediateFlowQuery <UserEntity> query = DummyQuery <UserEntity>();

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

            IStreamedFlowQuery <UserEntity> morphed = query
                                                      .Streamed();

            Assert.That(morphed, Is.Not.Null);
        }
示例#4
0
        public void CanMorphDetachedToStreamed()
        {
            IDetachedFlowQuery <UserEntity> query = DummyQuery <UserEntity>()
                                                    .Detached();

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

            IStreamedFlowQuery <UserEntity> morphed = query
                                                      .Streamed();

            Assert.That(morphed, Is.Not.Null);
        }
        public void CanCreateStatelessStreamedFlowQueryWithAlias()
        {
            UserEntity alias = null;

            Assert.That(() => StatelessSession.StreamedFlowQuery(() => alias), Throws.Nothing);

            IStreamedFlowQuery <UserEntity> query = StatelessSession.StreamedFlowQuery(() => alias);

            Assert.That(query != null);

            ICriteria criteria = new CriteriaBuilder()
                                 .Build <UserEntity, UserEntity>(QuerySelection.Create(query as IQueryableFlowQuery));

            Assert.That(criteria.Alias, Is.EqualTo("alias"));
        }
        public virtual void TestStreamedCopy()
        {
            IStreamedFlowQuery <UserEntity> query1 = Query <UserEntity>()
                                                     .Streamed();

            IStreamedFlowQuery <UserEntity> query2 = query1.Copy()
                                                     .Where(x => x.IsOnline);

            var users1 = new DummyResultStream <UserEntity, UserEntity>();
            var users2 = new DummyResultStream <UserEntity, UserEntity>();

            query1.Select(users1);
            query2.Select(users2);

            Assert.That(users1.Items.Count(), Is.EqualTo(4));
            Assert.That(users2.Items.Count(), Is.EqualTo(3));
        }
示例#7
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);
            }
        }