From 8da3dea04dbf9f87dd10907f0cadad400332cf27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Thu, 31 Oct 2024 12:16:58 +0100 Subject: [PATCH] Tweaks --- ...cial_characters_configured_for_endpoint.cs | 66 +++++++++---------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/src/NServiceBus.Transport.SqlServer.AcceptanceTests/MultiCatalog/When_catalog_with_special_characters_configured_for_endpoint.cs b/src/NServiceBus.Transport.SqlServer.AcceptanceTests/MultiCatalog/When_catalog_with_special_characters_configured_for_endpoint.cs index 22d3bae4d..1a91dca05 100644 --- a/src/NServiceBus.Transport.SqlServer.AcceptanceTests/MultiCatalog/When_catalog_with_special_characters_configured_for_endpoint.cs +++ b/src/NServiceBus.Transport.SqlServer.AcceptanceTests/MultiCatalog/When_catalog_with_special_characters_configured_for_endpoint.cs @@ -1,50 +1,46 @@ -namespace NServiceBus.Transport.SqlServer.AcceptanceTests.MultiCatalog +namespace NServiceBus.Transport.SqlServer.AcceptanceTests.MultiCatalog; + +using System.Threading.Tasks; +using AcceptanceTesting; +using NUnit.Framework; + +public class When_catalog_with_special_characters_configured_for_endpoint : MultiCatalogAcceptanceTest { - using System.Threading.Tasks; - using AcceptanceTesting; - using NUnit.Framework; + static string EndpointConnectionString => WithCustomCatalog(GetDefaultConnectionString(), "n service.bus&*#"); - public class When_catalog_with_special_characters_configured_for_endpoint : MultiCatalogAcceptanceTest + [Test] + public async Task Should_be_able_to_send_messages_to_the_endpoint() { - static string EndpointConnectionString => WithCustomCatalog(GetDefaultConnectionString(), "n service.bus&*#"); + await Scenario.Define() + .WithEndpoint(c => c.When(s => s.SendLocal(new Message()))) + .Done(c => c.MessageReceived) + .Run(); - [Test] - public async Task Should_be_able_to_send_messages_to_the_endpoint() - { - await Scenario.Define() - .WithEndpoint(c => c.When(s => s.SendLocal(new Message()))) - .Done(c => c.MessageReceived) - .Run(); + Assert.Pass(); + } - Assert.Pass(); - } + public class AnEndpoint : EndpointConfigurationBuilder + { + public AnEndpoint() => + EndpointSetup(new CustomizedServer(EndpointConnectionString), (_, _) => { }); - public class AnEndpoint : EndpointConfigurationBuilder + class Handler(Context scenarioContext) : IHandleMessages { - public AnEndpoint() => - EndpointSetup(new CustomizedServer(EndpointConnectionString), (c, sd) => - { - }); - - - class Handler(Context scenarioContext) : IHandleMessages + public Task Handle(Message message, IMessageHandlerContext context) { - public Task Handle(Message message, IMessageHandlerContext context) - { - scenarioContext.MessageReceived = true; + scenarioContext.MessageReceived = true; - return Task.FromResult(0); - } + return Task.FromResult(0); } } + } - public class Message : ICommand - { - } + public class Message : ICommand + { + } - class Context : ScenarioContext - { - public bool MessageReceived { get; set; } - } + class Context : ScenarioContext + { + public bool MessageReceived { get; set; } } } \ No newline at end of file