public void TestInit()
        {
            var preProcessor = new PreProcessorService();
            var mediator     = new Mediator.Mediators.Mediator(preProcessor);

            mediator.Register(new IMessageHandler[]
            {
                new CommandReceiver(), new EventListener(), new OtherEventListener(),
                new RequestHandler()
            }, new IMessageHandlerAsync[]
            {
                new AsyncCommandReceiver(), new AsyncEventListener(), new OtherAsyncEventListener(),
                new AsyncRequestHandler()
            });
            _mediator = mediator;

            var altMediator = new Mediator.Mediators.Mediator(preProcessor);

            altMediator.Register(new IMessageHandler[]
            {
                new AlternateCommandReceiver(), new OtherAlternateCommandReceiver(),
                new EventListener(), new OtherEventListener(),
                new RequestWithSeveralHandlersHandler(), new OtherRequestWithSeveralHandlersHandler()
            }, new IMessageHandlerAsync[]
            {
                new AlternateAsyncCommandReceiver(), new OtherAlternateAsyncCommandReceiver(),
                new AsyncEventListener(), new OtherAsyncEventListener(),
                new RequestWithSeveralHandlersAsyncHandler(), new OtherRequestWithSeveralHandlersAsyncHandler()
            });
            _altMediator = altMediator;
        }
Example #2
0
        public void TestInit()
        {
            var preProcessor = new PreProcessorService();
            var mediator     = new Mediator.Mediators.Mediator(preProcessor);

            mediator.Register(new IMessageHandler[]
            {
                new CommandReceiver(), new EventListener(), new OtherEventListener(),
                new RequestHandler()
            }, new IMessageHandlerAsync[]
            {
                new AsyncCommandReceiver(), new AsyncEventListener(), new OtherAsyncEventListener(),
                new AsyncRequestHandler()
            });
            _eventCollector =
                new EventCollectorFactory(mediator);
        }