public void TestOnOpenSession()
        {
            var @event = new AddOrderEvent(null);
            var crit = Mock<ICriteria>();

            using (Mocks.Record())
            {
                Expect.Call(crit.AddOrder(null)).Return(crit);
            }

            using (Mocks.Playback())
            {
                @event.OnEvent(crit);
            }
        }
Exemplo n.º 2
0
        public ICriteria AddOrder(Order order)
        {
            ICriteriaEvent criteriaEvent = new AddOrderEvent(order);

            foreach (IShard shard in shards)
            {
                if (shardToCriteriaMap[shard] != null)
                {
                    shardToCriteriaMap[shard].AddOrder(order);
                }
                else
                {
                    shardToEventListMap[shard].Add(criteriaEvent);
                }
            }

            return(this);
        }