public void RegisterRabbitMQConnection_Requires_Builder() { // arrange IConfiguration config = new ConfigurationBuilder().Build(); // act & assert Assert.Throws <ArgumentNullException>(() => RabbitMQContainerBuilderExtensions.RegisterRabbitMQConnection(null, config)); }
public void RegisterRabbitMQConnection_Requires_Config() { // arrange ContainerBuilder cb = new ContainerBuilder(); // act & assert Assert.Throws <ArgumentNullException>(() => RabbitMQContainerBuilderExtensions.RegisterRabbitMQConnection(cb, null)); }
public void RegisterRabbitMQConnection_AddsHealthContributorToContainer() { // arrange ContainerBuilder container = new ContainerBuilder(); IConfiguration config = new ConfigurationBuilder().Build(); // act var regBuilder = RabbitMQContainerBuilderExtensions.RegisterRabbitMQConnection(container, config); var services = container.Build(); var healthContributor = services.Resolve <IHealthContributor>(); // assert Assert.NotNull(healthContributor); Assert.IsType <RabbitMQHealthContributor>(healthContributor); }
public void RegisterRabbitMQConnection_AddsToContainer() { // arrange ContainerBuilder container = new ContainerBuilder(); IConfiguration config = new ConfigurationBuilder().Build(); // act var regBuilder = RabbitMQContainerBuilderExtensions.RegisterRabbitMQConnection(container, config); var services = container.Build(); var rabbitMQIFactory = services.Resolve <IConnectionFactory>(); var rabbitMQFactory = services.Resolve <ConnectionFactory>(); // assert Assert.NotNull(rabbitMQIFactory); Assert.NotNull(rabbitMQFactory); Assert.IsType <ConnectionFactory>(rabbitMQIFactory); Assert.IsType <ConnectionFactory>(rabbitMQFactory); }