public void TestNoFailOnStartupWithMissingBroker()
        {
            var connectionFactory = new SingleConnectionFactory("foo");

            connectionFactory.Port = 434343;
            var applicationContext = new GenericApplicationContext();

            applicationContext.ObjectFactory.RegisterSingleton("foo", new Queue("queue"));
            var rabbitAdmin = new RabbitAdmin(connectionFactory);

            rabbitAdmin.ApplicationContext = applicationContext;
            rabbitAdmin.AutoStartup        = true;
            rabbitAdmin.AfterPropertiesSet();
        }
        public void TestFailOnFirstUseWithMissingBroker()
        {
            var connectionFactory = new SingleConnectionFactory("foo");

            connectionFactory.Port = 434343;
            var applicationContext = new GenericApplicationContext();

            applicationContext.ObjectFactory.RegisterSingleton("foo", new Queue("queue"));
            var rabbitAdmin = new RabbitAdmin(connectionFactory);

            rabbitAdmin.ApplicationContext = applicationContext;
            rabbitAdmin.AutoStartup        = true;
            rabbitAdmin.AfterPropertiesSet();

            try
            {
                rabbitAdmin.DeclareQueue();
            }
            catch (Exception ex)
            {
                Assert.True(ex is AmqpIOException, "Expecting an AmqpIOException");
            }
        }