Skip to content

Commit

Permalink
Merge pull request #1463 from Particular/cherry-pick-1461
Browse files Browse the repository at this point in the history
Release PR for 1461
  • Loading branch information
WilliamBZA authored Nov 6, 2024
2 parents a12efe0 + 0d46a13 commit 49b779b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
echo "Create extra databases"
sqlcmd -Q "CREATE DATABASE nservicebus1"
sqlcmd -Q "CREATE DATABASE nservicebus2"
sqlcmd -Q "CREATE DATABASE [n service.bus&#]"
echo "Create additional schemas"
sqlcmd -Q "CREATE SCHEMA receiver AUTHORIZATION db_owner" -d "nservicebus"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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(Context scenarioContext) : IHandleMessages<Message>
{
public Task Handle(Message message, IMessageHandlerContext context)
{
scenarioContext.MessageReceived = true;

return Task.FromResult(0);
}
}
}

public class Message : ICommand
{
}

class Context : ScenarioContext
{
public bool MessageReceived { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ THEN DATEADD(ms, @TimeToBeReceivedMs, GETUTCDATE()) END,

public string CheckIfTableHasRecoverableText { get; set; } = @"
SELECT COUNT(*)
FROM {0}.sys.columns c
FROM [{0}].sys.columns c
WHERE c.object_id = OBJECT_ID(N'{1}')
AND c.name = 'Recoverable'";

Expand Down

0 comments on commit 49b779b

Please sign in to comment.