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); }