Ejemplo n.º 1
0
        public void SetsFacilityIfInformationIsAvailable()
        {
            IKnowAboutConfiguredFacility knownFacility = new KnownFacility("test");
            var clientProperties = AmqpClientProperties.WithFacility(knownFacility);

            Assert.That(clientProperties["facility"], Is.EqualTo("test"));
        }
Ejemplo n.º 2
0
        public void CreatesDefaultClientPropertiesAccordingToStandard()
        {
            IKnowAboutConfiguredFacility noFacilityInformation = new StubFacilityInformation();
            var clientProperties = AmqpClientProperties.WithFacility(noFacilityInformation);

            var expectedVersion = Assembly.GetAssembly(typeof(AmqpClientProperties)).GetName().Version;

            Assert.That(clientProperties["product"], Is.EqualTo("rabbitmq.log4net.gelf.appender"));
            Assert.That(clientProperties["version"], Is.EqualTo(expectedVersion.ToString()));
            Assert.That(clientProperties["platform"], Is.EqualTo(Environment.OSVersion.Platform.ToString()));
        }
Ejemplo n.º 3
0
 protected virtual ConnectionFactory CreateConnectionFactory()
 {
     return(new ConnectionFactory
     {
         Protocol = Protocols.FromEnvironment(),
         HostName = this.HostName,
         Port = this.Port,
         VirtualHost = this.VirtualHost,
         UserName = this.Username,
         Password = this.Password,
         ClientProperties = AmqpClientProperties.WithFacility(this.facilityInformation)
     });
 }
Ejemplo n.º 4
0
        public void ProvidesHostNameInClientProperties()
        {
            var clientProperties = AmqpClientProperties.WithFacility(new StubFacilityInformation());

            Assert.That(clientProperties["host"], Is.EqualTo(Environment.MachineName));
        }