public void CreateConnectionWithClientProvidedName() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); Assert.Throws <NotImplementedException>(() => connectionFactoryRabbitMQ.CreateConnection("clientProvidedName")); }
public void ContinuationTimeout() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.ContinuationTimeout = new TimeSpan(5, 10, 15); Assert.Equal(new TimeSpan(5, 10, 15), connectionFactoryRabbitMQ.ContinuationTimeout); }
public void RequestedHeartbeatGetSet() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.RequestedHeartbeat = TimeSpan.FromSeconds(1); Assert.Equal(TimeSpan.FromSeconds(1), connectionFactoryRabbitMQ.RequestedHeartbeat); }
public void HandshakeContinuationTimeout() { var queueProviderSettings = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(queueProviderSettings.Object); connectionFactoryRabbitMQ.HandshakeContinuationTimeout = new TimeSpan(5, 10, 15); Assert.Equal(new TimeSpan(5, 10, 15), connectionFactoryRabbitMQ.HandshakeContinuationTimeout); }
public void NetworkRecoveryInterval() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.NetworkRecoveryInterval = new TimeSpan(5, 10, 15); Assert.Equal(new TimeSpan(5, 10, 15), connectionFactoryRabbitMQ.NetworkRecoveryInterval); }
public void PortGetSet() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.Port = 5333; Assert.Equal(5333, connectionFactoryRabbitMQ.Port); }
public void Uri() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.Uri = new Uri("amqp://test.ru"); Assert.Equal("amqp://test.ru/", connectionFactoryRabbitMQ.Uri.ToString()); }
public void HostNameGetSet() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.HostName = "host"; Assert.Equal("host", connectionFactoryRabbitMQ.HostName); }
public void VirtualHostGetSet() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.VirtualHost = "h"; Assert.Equal("h", connectionFactoryRabbitMQ.VirtualHost); }
public void UseBackgroundThreadsForIOGetSet() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.UseBackgroundThreadsForIO = true; Assert.True(connectionFactoryRabbitMQ.UseBackgroundThreadsForIO); }
public void RequestedChannelMaxGetSet() { var queueProviderSettings = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(queueProviderSettings.Object); connectionFactoryRabbitMQ.RequestedChannelMax = 120; Assert.Equal(120, connectionFactoryRabbitMQ.RequestedChannelMax); }
public void AutomaticRecoveryEnabled() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.AutomaticRecoveryEnabled = true; Assert.True(connectionFactoryRabbitMQ.AutomaticRecoveryEnabled); }
public void UserNameGetSet() { var queueProviderSettings = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(queueProviderSettings.Object); connectionFactoryRabbitMQ.UserName = "******"; Assert.Equal("u", connectionFactoryRabbitMQ.UserName); }
public void PasswordGetSet() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.Password = "******"; Assert.Equal("pass", connectionFactoryRabbitMQ.Password); }
public void RequestedFrameMaxGetSet() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.RequestedFrameMax = 120; Assert.Equal((uint)120, connectionFactoryRabbitMQ.RequestedFrameMax); }
public void CreateConnectionWithClientProvidedNameAndEndpoints() { var queueProviderSettings = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(queueProviderSettings.Object); Assert.Throws <NotImplementedException>(() => connectionFactoryRabbitMQ.CreateConnection(new List <AmqpTcpEndpoint>() { })); }
public void CreateConnectionWithHostnames() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); Assert.Throws <NotImplementedException>(() => connectionFactoryRabbitMQ.CreateConnection(new List <string>() { })); }
public void CreateConnectionWithClientProvidedNameAndHostnames() { var queueProviderSettings = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(queueProviderSettings.Object); Assert.Throws <NotImplementedException>(() => connectionFactoryRabbitMQ.CreateConnection(new List <string>() { }, "clientProvidedName")); }
public void AuthMechanismFactory() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); connectionFactoryRabbitMQ.AuthMechanismFactory(new List <string>() { }); }
public void ClientPropertiesGetSet() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, queueProviderSettings.Object); var dict = new Dictionary <string, object>(); dict.Add("prop1", "value"); connectionFactoryRabbitMQ.ClientProperties = dict; Assert.True(connectionFactoryRabbitMQ.ClientProperties.TryGetValue("prop1", out object value)); Assert.Equal("value", (string)value); }
public void CreateConnectionShouldThrowsExceptionIfUsedNotSuitableHost() { var(appLogger, queueProviderSettings) = GetMocks(); var connectionFactoryRabbitMQ = new ConnectionFactoryRabbitMQ(appLogger.Object, new QueueProviderSettings { Host = "localhost", Login = "******", Password = "******", VirtualHost = "virtualHost", }); Assert.Throws <BrokerUnreachableException>(() => connectionFactoryRabbitMQ.CreateConnection()); }