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);
            }
        }
Ejemplo n.º 2
0
        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);
        }