Beispiel #1
0
        public QueueReader(IConfiguration configuration, ILogger <QueueReader> log, ReceiveHandlerFactory handlerFactory)
        {
            logger = log;

            configuration.GetSection("ComponentQueue").Bind(config);

            factory = new ConnectionFactory()
            {
                Uri = new Uri(config.Connection)
            };

            _handlerFactory = handlerFactory;
        }
        public void Create_ConstructsAChainOfHandlersCorrectly()
        {
            var factory = new ReceiveHandlerFactory();
            var handler = factory.Create();

            var order = new[]
            {
                typeof(TransceiverMessageHandler),
                typeof(InterfaceResponseMessageHandler),
                typeof(ChimeMessageHandler),
                typeof(UnhandledMessageHandler)
            };

            AssertHandleOrder(handler, order);
        }