Ejemplo n.º 1
0
        public void TestSetCacheRegionEventCacheRegion()
        {
            SetCacheRegionEvent eve = new SetCacheRegionEvent(null);

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

            using (Mocks.Playback())
            {
                eve.OnEvent(query);
            }
        }
Ejemplo n.º 2
0
        public IQuery SetCacheRegion(string cacheRegion)
        {
            IQueryEvent queryEvent = new SetCacheRegionEvent(cacheRegion);

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