Exemple #1
0
        public Channel(IModel model, RabbitMQUriParser parser, IRabbitMQConfiguration configuration)
        {
            Guard.AgainstNull(model, "model");
            Guard.AgainstNull(parser, "parser");
            Guard.AgainstNull(configuration, "configuration");

            Model = model;

            _queue = parser.Queue;

            _millisecondsTimeout = parser.Local
                           ? configuration.LocalQueueTimeoutMilliseconds
                           : configuration.RemoteQueueTimeoutMilliseconds;
        }
        public void Should_be_able_to_parse_an_ip_address()
        {
            var parser = new RabbitMQUriParser(new Uri("rabbitmq://127.0.0.1/work-queue"));

            Assert.AreEqual("rabbitmq://127.0.0.1/work-queue", parser.Uri.ToString());
        }
        public void Should_be_able_to_parse_a_valid_uri()
        {
            var parser = new RabbitMQUriParser(new Uri("rabbitmq://./work-queue"));

            Assert.AreEqual("rabbitmq://localhost/work-queue", parser.Uri.ToString());
        }
        public void Should_be_able_to_create_with_set_parameters()
        {
            var parser = new RabbitMQUriParser(new Uri("rabbitmq://./work-queue?prefetchCount=1"));

            Assert.AreEqual(1, parser.PrefetchCount);
        }