From d36c01c1791cc5418b0f1db71d7f3d9593d3f573 Mon Sep 17 00:00:00 2001 From: Michael Fyffe <6224270+TraGicCode@users.noreply.github.com> Date: Sat, 6 Dec 2025 11:38:46 -0600 Subject: [PATCH] Fix SendOnly transports creating receivers --- .../Factories/RawEndpointFactory.cs | 22 ++++++++++--------- .../Infrastructure/ITestEndpointFactory.cs | 6 ++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/BuslyCLI.Console/Factories/RawEndpointFactory.cs b/src/BuslyCLI.Console/Factories/RawEndpointFactory.cs index d0ad5db..a70cc49 100644 --- a/src/BuslyCLI.Console/Factories/RawEndpointFactory.cs +++ b/src/BuslyCLI.Console/Factories/RawEndpointFactory.cs @@ -163,16 +163,18 @@ private static async Task InternalCreateInfrastructure( }, isReceiveEnabled); - - var infrastructure = await transport.Initialize(hostSettings, new[] - { - new ReceiveSettings( - "Primary", - new QueueAddress(endpointName), - isReceiveEnabled, - false, - "error") - }, new string[0]); + var infrastructure = await transport.Initialize(hostSettings, + isReceiveEnabled + ? + [ + new ReceiveSettings( + "Primary", + new QueueAddress(endpointName), + isReceiveEnabled, + false, + "error") + ] + : [], []); return infrastructure; diff --git a/tests/BuslyCLI.Console.Tests/EndToEnd/Infrastructure/ITestEndpointFactory.cs b/tests/BuslyCLI.Console.Tests/EndToEnd/Infrastructure/ITestEndpointFactory.cs index 8052360..6144c12 100644 --- a/tests/BuslyCLI.Console.Tests/EndToEnd/Infrastructure/ITestEndpointFactory.cs +++ b/tests/BuslyCLI.Console.Tests/EndToEnd/Infrastructure/ITestEndpointFactory.cs @@ -78,15 +78,15 @@ private static async Task InternalCreateTestEndpoint(string endpoi // TODO: This needs to be false for "Azure Service Bus Emulator" tests to pass transport is not AzureServiceBusTransport); - var infrastructure = await transport.Initialize(hostSettings, new[] - { + var infrastructure = await transport.Initialize(hostSettings, [ new ReceiveSettings( "Primary", new QueueAddress(endpointName), true, false, "error") - }, new string[0]); + ], []); + return new TestEndpoint(infrastructure); }