-
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.
Merge pull request #1464 from Particular/cherry-pick-1461-v7
Quote the catalog name when preparing the send command text in SQL Server
- Loading branch information
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
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
54 changes: 54 additions & 0 deletions
54
...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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
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 | ||
{ | ||
static string EndpointConnectionString => WithCustomCatalog(GetDefaultConnectionString(), "n service.bus&#"); | ||
|
||
[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(); | ||
} | ||
|
||
public class AnEndpoint : EndpointConfigurationBuilder | ||
{ | ||
public AnEndpoint() => | ||
EndpointSetup(new CustomizedServer(EndpointConnectionString), (_, __) => { }); | ||
|
||
class Handler : IHandleMessages<Message> | ||
{ | ||
public Handler(Context scenarioContext) | ||
{ | ||
ScenarioContext = scenarioContext; | ||
} | ||
|
||
public Task Handle(Message message, IMessageHandlerContext context) | ||
{ | ||
ScenarioContext.MessageReceived = true; | ||
|
||
return Task.FromResult(0); | ||
} | ||
|
||
Context ScenarioContext; | ||
} | ||
} | ||
|
||
public class Message : ICommand | ||
{ | ||
} | ||
|
||
class Context : ScenarioContext | ||
{ | ||
public bool MessageReceived { get; set; } | ||
} | ||
} | ||
} |
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