Skip to content

Commit 8da3dea

Browse files
andreasohlundWilliamBZA
authored andcommitted
Tweaks
1 parent 7135abc commit 8da3dea

File tree

1 file changed

+31
-35
lines changed

1 file changed

+31
-35
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,46 @@
1-
namespace NServiceBus.Transport.SqlServer.AcceptanceTests.MultiCatalog
1+
namespace NServiceBus.Transport.SqlServer.AcceptanceTests.MultiCatalog;
2+
3+
using System.Threading.Tasks;
4+
using AcceptanceTesting;
5+
using NUnit.Framework;
6+
7+
public class When_catalog_with_special_characters_configured_for_endpoint : MultiCatalogAcceptanceTest
28
{
3-
using System.Threading.Tasks;
4-
using AcceptanceTesting;
5-
using NUnit.Framework;
9+
static string EndpointConnectionString => WithCustomCatalog(GetDefaultConnectionString(), "n service.bus&*#");
610

7-
public class When_catalog_with_special_characters_configured_for_endpoint : MultiCatalogAcceptanceTest
11+
[Test]
12+
public async Task Should_be_able_to_send_messages_to_the_endpoint()
813
{
9-
static string EndpointConnectionString => WithCustomCatalog(GetDefaultConnectionString(), "n service.bus&*#");
14+
await Scenario.Define<Context>()
15+
.WithEndpoint<AnEndpoint>(c => c.When(s => s.SendLocal(new Message())))
16+
.Done(c => c.MessageReceived)
17+
.Run();
1018

11-
[Test]
12-
public async Task Should_be_able_to_send_messages_to_the_endpoint()
13-
{
14-
await Scenario.Define<Context>()
15-
.WithEndpoint<AnEndpoint>(c => c.When(s => s.SendLocal(new Message())))
16-
.Done(c => c.MessageReceived)
17-
.Run();
19+
Assert.Pass();
20+
}
1821

19-
Assert.Pass();
20-
}
22+
public class AnEndpoint : EndpointConfigurationBuilder
23+
{
24+
public AnEndpoint() =>
25+
EndpointSetup(new CustomizedServer(EndpointConnectionString), (_, _) => { });
2126

22-
public class AnEndpoint : EndpointConfigurationBuilder
27+
class Handler(Context scenarioContext) : IHandleMessages<Message>
2328
{
24-
public AnEndpoint() =>
25-
EndpointSetup(new CustomizedServer(EndpointConnectionString), (c, sd) =>
26-
{
27-
});
28-
29-
30-
class Handler(Context scenarioContext) : IHandleMessages<Message>
29+
public Task Handle(Message message, IMessageHandlerContext context)
3130
{
32-
public Task Handle(Message message, IMessageHandlerContext context)
33-
{
34-
scenarioContext.MessageReceived = true;
31+
scenarioContext.MessageReceived = true;
3532

36-
return Task.FromResult(0);
37-
}
33+
return Task.FromResult(0);
3834
}
3935
}
36+
}
4037

41-
public class Message : ICommand
42-
{
43-
}
38+
public class Message : ICommand
39+
{
40+
}
4441

45-
class Context : ScenarioContext
46-
{
47-
public bool MessageReceived { get; set; }
48-
}
42+
class Context : ScenarioContext
43+
{
44+
public bool MessageReceived { get; set; }
4945
}
5046
}

0 commit comments

Comments
 (0)