public void TestSetFetchSizeEventFetchSize()
        {
            SetFetchSizeEvent eve = new SetFetchSizeEvent(-1);
            IQuery query = Mock<IQuery>();
            using (Mocks.Record())
            {
                Expect.Call(query.SetFetchSize(-1)).Return(query);
            }

            using (Mocks.Playback())
            {
                eve.OnEvent(query);
            }
        }
Exemplo n.º 2
0
        public IQuery SetFetchSize(int fetchSize)
        {
            IQueryEvent queryEvent = new SetFetchSizeEvent(fetchSize);

            foreach (IShard shard in shards)
            {
                if (shard.GetQueryById(queryId) != null)
                {
                    shard.GetQueryById(queryId).SetFetchSize(fetchSize);
                }
                else
                {
                    shard.AddQueryEvent(queryId, queryEvent);
                }
            }
            return(this);
        }