Exemplo n.º 1
0
        public void TestSetReadOnlyEventReadOnly()
        {
            SetReadOnlyEvent eve = new SetReadOnlyEvent(true);
            IQuery query = Mock<IQuery>();
            using (Mocks.Record())
            {
                Expect.Call(query.SetReadOnly(true)).Return(query);
            }

            using (Mocks.Playback())
            {
                eve.OnEvent(query);
            }
        }
Exemplo n.º 2
0
        public IQuery SetReadOnly(bool readOnly)
        {
            IQueryEvent queryEvent = new SetReadOnlyEvent(readOnly);

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