public INotifyMessageReceived CreateMessageReceiver(Func<TransportMessage, bool> tryProcessMessage, Action<TransportMessage, Exception> endProcessMessage)
        {
            var messageProcessor = Configure.Instance.Builder.Build<IProcessMessages>();
            messageProcessor.TryProcessMessage = tryProcessMessage;
            messageProcessor.EndProcessMessage = endProcessMessage;

            var subscriptionManager = Configure.Instance.Builder.Build<INotifyTopicSubscriptions>();
            var eventConsumer = new EventConsumer(subscriptionManager, messageProcessor) { ConsumerName = this.ConsumerName };

            var messageReceiver = new ActiveMqMessageReceiver(eventConsumer, messageProcessor);

            return messageReceiver;
        }
        public void SetUp()
        {
            Configure.Transactions.Enable()
                      .Advanced(
                          settings =>
                          settings.DefaultTimeout(TimeSpan.FromSeconds(10))
                                  .IsolationLevel(IsolationLevel.ReadCommitted)
                                  .EnableDistributedTransactions());

            this.messageProcessorMock = new Mock<IProcessMessages>();
            this.eventConsumerMock = new Mock<IConsumeEvents>();
            this.messageConsumerMock = new Mock<IMessageConsumer>();

            this.testee = new ActiveMqMessageReceiver(
                this.eventConsumerMock.Object,
                this.messageProcessorMock.Object);

            this.messageProcessorMock
                .Setup(mp => mp.CreateMessageConsumer(It.IsAny<string>()))
                .Returns(this.messageConsumerMock.Object);

            Address.InitializeLocalAddress("local");
        }