diff --git a/Tapeti.Tests/Client/RabbitMQFixture.cs b/Tapeti.Tests/Client/RabbitMQFixture.cs index 4d1c66d..4a46634 100644 --- a/Tapeti.Tests/Client/RabbitMQFixture.cs +++ b/Tapeti.Tests/Client/RabbitMQFixture.cs @@ -33,7 +33,7 @@ namespace Tapeti.Tests.Client private const string ImageName = "rabbitmq"; - private const string ImageTag = "3.11.3-alpine"; + private const string ImageTag = "3.11.3-management-alpine"; public async Task InitializeAsync() diff --git a/Tapeti.Tests/Client/TapetiClientTests.cs b/Tapeti.Tests/Client/TapetiClientTests.cs index bfd1cfe..0ffd716 100644 --- a/Tapeti.Tests/Client/TapetiClientTests.cs +++ b/Tapeti.Tests/Client/TapetiClientTests.cs @@ -1,7 +1,10 @@ -using System.Text; +using System; +using System.Collections.Generic; +using System.Text; using System.Threading; using System.Threading.Tasks; using FluentAssertions; +using RabbitMQ.Client; using Tapeti.Connection; using Tapeti.Default; using Tapeti.Exceptions; @@ -68,6 +71,31 @@ namespace Tapeti.Tests.Client } + [Fact] + public async Task DurableQueueDeclareIncompatibleArguments() + { + using var rabbitmqClient = CreateRabbitMQClient(); + using var model = rabbitmqClient.CreateModel(); + + var ok = model.QueueDeclare("incompatibleargs", true, false, false, new Dictionary + { + { "x-dead-letter-exchange", "d34db33f" } + }); + + model.Close(); + rabbitmqClient.Close(); + + + ok.Should().NotBeNull(); + + + await client.DurableQueueDeclare("incompatibleargs", new QueueBinding[] + { + new("test", "#") + }, null, CancellationToken.None); + } + + [Fact] public async Task PublishHandleOverflow() { @@ -97,6 +125,21 @@ namespace Tapeti.Tests.Client // TODO test the other methods + private RabbitMQ.Client.IConnection CreateRabbitMQClient() + { + var connectionFactory = new ConnectionFactory + { + HostName = "127.0.0.1", + Port = fixture.RabbitMQPort, + UserName = RabbitMQFixture.RabbitMQUsername, + Password = RabbitMQFixture.RabbitMQPassword, + AutomaticRecoveryEnabled = false, + TopologyRecoveryEnabled = false + }; + + return connectionFactory.CreateConnection(); + } + private TapetiClient CreateClient() { diff --git a/Tapeti/Tapeti.csproj b/Tapeti/Tapeti.csproj index 2d1bd84..18a03ff 100644 --- a/Tapeti/Tapeti.csproj +++ b/Tapeti/Tapeti.csproj @@ -25,7 +25,7 @@ - +