-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7135abc
commit 8da3dea
Showing
1 changed file
with
31 additions
and
35 deletions.
There are no files selected for viewing
66 changes: 31 additions & 35 deletions
66
...eptanceTests/MultiCatalog/When_catalog_with_special_characters_configured_for_endpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Context>() | ||
.WithEndpoint<AnEndpoint>(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<Context>() | ||
.WithEndpoint<AnEndpoint>(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<Message> | ||
{ | ||
public AnEndpoint() => | ||
EndpointSetup(new CustomizedServer(EndpointConnectionString), (c, sd) => | ||
{ | ||
}); | ||
|
||
|
||
class Handler(Context scenarioContext) : IHandleMessages<Message> | ||
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; } | ||
} | ||
} |