Burrow.Tests.Internal.ManagedConnectionFactoryTests.MethodCreateConnection.Should_fire_event_when_new_connection_established C# (CSharp) Метод

Should_fire_event_when_new_connection_established() приватный Метод

private Should_fire_event_when_new_connection_established ( ) : void
Результат void
        public void Should_fire_event_when_new_connection_established()
        {
            var connectedEndpoint = string.Empty;
            var connection1 = Substitute.For<IConnection>();
            connection1.IsOpen.Returns(true);

            var factory1 = Substitute.For<ManagedConnectionFactory>();
            factory1.HostName = "localhost";
            factory1.VirtualHost = "/virtualhost";
            factory1.EstablishConnection().Returns(connection1);

            ManagedConnectionFactory.ConnectionEstablished += (a, b) => { connectedEndpoint = a + b; };

            // Action
            factory1.CreateConnection();
            Assert.AreEqual("amqp://localhost:5672/virtualhost", connectedEndpoint);
        }
    }