public void Initialize()
        {
            var q = new MockQ();

            _bus   = new MockEventBus(q);
            _store = new EventStoreMock <int>();
            _repo  = new InputAggregateRepo(_store, _bus);
            _eventListenerRegister = q.GetHandlerRegister("Mock");
        }
        public void Initialize()
        {
            var q = new MockQ();

            _bus                   = new MockEventBus(q);
            _store                 = new EventStoreCrudMock <int>();
            _idProvider            = new EventIdProvider <int>(_store);
            _repo                  = new TransactionnalInputAggregateRepo(_store, _bus, _idProvider);
            _saver                 = _repo as ITransactionnalSave <InputAggregate, int>;
            _eventListenerRegister = q.GetHandlerRegister("Mock");
        }
Exemplo n.º 3
0
        static void TestMockQScenario2()
        {
            var q                   = new MockQ();
            var exchangeName        = "Test";
            var publisher           = q.GetMessagePublisher(exchangeName);
            var handlerRegistration = q.GetHandlerRegister(exchangeName);

            var are            = new AutoResetEvent(false);
            var messageHandler = new MessageProcessor(handlerRegistration, are);
            var msgProcessor   = new MessageProducer(publisher);

            Task.Factory.StartNew(msgProcessor.Run);
            are.WaitOne();
            Console.WriteLine("Back to main thread");
            Console.ReadKey();
        }