public void TestSetLockModeEventLockMode() { SetLockModeEvent eve = new SetLockModeEvent(null, null); IQuery query = Mock<IQuery>(); using (Mocks.Record()) { Expect.Call(query.SetLockMode(null, null)).Return(query); } using (Mocks.Playback()) { eve.OnEvent(query); } }
public IQuery SetLockMode(string alias, LockMode lockMode) { IQueryEvent queryEvent = new SetLockModeEvent(alias, lockMode); foreach (IShard shard in shards) { if (shard.GetQueryById(queryId) != null) { shard.GetQueryById(queryId).SetLockMode(alias, lockMode); } else { shard.AddQueryEvent(queryId, queryEvent); } } return(this); }