public void DirectBindingWithQueueName()
        {
            var directExchange = new DirectExchange("d");
            var binding        = BindingBuilder.Bind(queue).To(directExchange).WithQueueName();

            Assert.NotNull(binding);
            Assert.Equal(directExchange.ExchangeName, binding.Exchange);
            Assert.Equal(Binding.DestinationType.QUEUE, binding.Type);
            Assert.Equal(queue.QueueName, binding.Destination);
            Assert.Equal(queue.QueueName, binding.RoutingKey);
        }
        public void ExchangeBinding()
        {
            var directExchange = new DirectExchange("d");
            var fanoutExchange = new FanoutExchange("f");
            var binding        = BindingBuilder.Bind(directExchange).To(fanoutExchange);

            Assert.NotNull(binding);
            Assert.Equal(fanoutExchange.ExchangeName, binding.Exchange);
            Assert.Equal(Binding.DestinationType.EXCHANGE, binding.Type);
            Assert.Equal(directExchange.ExchangeName, binding.Destination);
            Assert.Equal(string.Empty, binding.RoutingKey);
        }
示例#3
0
 public DirectExchangeRoutingKeyConfigurer To(DirectExchange exchange)
 {
     return(new DirectExchangeRoutingKeyConfigurer(this, exchange));
 }
示例#4
0
 public DirectExchangeRoutingKeyConfigurer(DestinationConfigurer destination, DirectExchange exchange)
     : base(destination, exchange.ExchangeName)
 {
 }