From 2a1cf428fd5deaaf9d17a5f951d0f582875c8fe9 Mon Sep 17 00:00:00 2001 From: "vitalie.glinca" Date: Tue, 21 Nov 2023 15:21:56 +0200 Subject: [PATCH] Add tests --- .../RabbitMqTransportTests.cs | 7 +++- .../response_queue_disabling.cs | 33 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/Transports/RabbitMQ/Wolverine.RabbitMQ.Tests/response_queue_disabling.cs diff --git a/src/Transports/RabbitMQ/Wolverine.RabbitMQ.Tests/RabbitMqTransportTests.cs b/src/Transports/RabbitMQ/Wolverine.RabbitMQ.Tests/RabbitMqTransportTests.cs index a055329e5..e661ae20e 100644 --- a/src/Transports/RabbitMQ/Wolverine.RabbitMQ.Tests/RabbitMqTransportTests.cs +++ b/src/Transports/RabbitMQ/Wolverine.RabbitMQ.Tests/RabbitMqTransportTests.cs @@ -1,7 +1,6 @@ using JasperFx.Core; using Shouldly; using Wolverine.RabbitMQ.Internal; -using Wolverine.Util; using Xunit; namespace Wolverine.RabbitMQ.Tests; @@ -61,4 +60,10 @@ public void default_dead_letter_queue_settings() theTransport.DeadLetterQueue.QueueName.ShouldBe(RabbitMqTransport.DeadLetterQueueName); theTransport.DeadLetterQueue.ExchangeName.ShouldBe(RabbitMqTransport.DeadLetterQueueName); } + + [Fact] + public void declare_request_reply_system_queue_is_true_by_default() + { + theTransport.DeclareRequestReplySystemQueue.ShouldBeTrue(); + } } \ No newline at end of file diff --git a/src/Transports/RabbitMQ/Wolverine.RabbitMQ.Tests/response_queue_disabling.cs b/src/Transports/RabbitMQ/Wolverine.RabbitMQ.Tests/response_queue_disabling.cs new file mode 100644 index 000000000..0cffb2a47 --- /dev/null +++ b/src/Transports/RabbitMQ/Wolverine.RabbitMQ.Tests/response_queue_disabling.cs @@ -0,0 +1,33 @@ +using Microsoft.Extensions.Hosting; +using Shouldly; +using Xunit; + +namespace Wolverine.RabbitMQ.Tests; + +public class response_queue_disabling : IAsyncLifetime +{ + private IHost _host; + + [Fact] + public void reply_queue_should_not_be_declared() + { + var transport = _host.Get().RabbitMqTransport(); + + transport.ReplyEndpoint() + .ShouldBeNull(); + } + + public async Task InitializeAsync() + { + _host = await Host.CreateDefaultBuilder() + .UseWolverine(opts => + { + opts.ServiceName = "MyApp"; + opts.UseRabbitMq() + .DisableSystemRequestReplyQueueDeclaration(); + }).StartAsync(); + } + + public Task DisposeAsync() => _host.StopAsync(); +} + \ No newline at end of file