public void SetsFacilityIfInformationIsAvailable() { IKnowAboutConfiguredFacility knownFacility = new KnownFacility("test"); var clientProperties = AmqpClientProperties.WithFacility(knownFacility); Assert.That(clientProperties["facility"], Is.EqualTo("test")); }
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())); }
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) }); }
public void ProvidesHostNameInClientProperties() { var clientProperties = AmqpClientProperties.WithFacility(new StubFacilityInformation()); Assert.That(clientProperties["host"], Is.EqualTo(Environment.MachineName)); }