コード例 #1
0
        public void TestSetCacheableEventCacheable()
        {
            SetCacheableEvent eve = new SetCacheableEvent(false);

            IQuery query = Mock<IQuery>();
            using (Mocks.Record())
            {
                Expect.Call(query.SetCacheable(false)).Return(query);
            }

            using (Mocks.Playback())
            {
                eve.OnEvent(query);
            }
        }
コード例 #2
0
        public IQuery SetCacheable(bool cacheable)
        {
            IQueryEvent queryEvent = new SetCacheableEvent(cacheable);

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