Пример #1
0
        public string VerifySubscriptionEndpointNoExchangeFailureTest()
        {
            var    transport = new RabbitMqTransport(_logFactory, HOST, "guest", "guest");
            string error;
            var    valid = transport.VerifyDestination(new Destination {
                Subscribe = "non.existing", Publish = "non.existing"
            }, EndpointUsage.Subscribe, false, out error);

            Assert.That(valid, Is.False, "endpoint reported as valid");
            Assert.That(error, Is.EqualTo(@"The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text=""NOT_FOUND - no exchange 'non.existing' in vhost '/'"", classId=40, methodId=10, cause="));
            return(error);
        }
Пример #2
0
        public void DefaultExchangeVerificationTest()
        {
            var defaultExchangeDestination = new Destination()
            {
                Subscribe = m_TempQueue,
                Publish   = new PublicationAddress("direct", "", m_TempQueue).ToString()
            };

            using (var transport = new RabbitMqTransport(_logFactory, HOST, "guest", "guest"))
            {
                var res = transport.VerifyDestination(defaultExchangeDestination, EndpointUsage.Publish | EndpointUsage.Subscribe, true, out var error);
                Console.WriteLine(error);
                Assert.That(res, Is.True);
            }
        }