Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalie.glinca authored and jeremydmiller committed Nov 21, 2023
1 parent f59f000 commit 2a1cf42
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using JasperFx.Core;
using Shouldly;
using Wolverine.RabbitMQ.Internal;
using Wolverine.Util;
using Xunit;

namespace Wolverine.RabbitMQ.Tests;
Expand Down Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -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<WolverineOptions>().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();
}

0 comments on commit 2a1cf42

Please sign in to comment.