public void TestSetCacheModeEventCacheMode() { SetCacheModeEvent eve = new SetCacheModeEvent(CacheMode.Normal); IQuery query = Mock<IQuery>(); using (Mocks.Record()) { Expect.Call(query.SetCacheMode(CacheMode.Normal)).Return(query); } using (Mocks.Playback()) { eve.OnEvent(query); } }
public IQuery SetCacheMode(CacheMode cacheMode) { IQueryEvent queryEvent = new SetCacheModeEvent(cacheMode); foreach (IShard shard in shards) { if (shard.GetQueryById(queryId) != null) { shard.GetQueryById(queryId).SetCacheMode(cacheMode); } else { shard.AddQueryEvent(queryId, queryEvent); } } return(this); }