-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensuring "Path" returns the right destination in the case of via-send…
…er (#6941) Fixing #6031 In the case of Via-Sender defined by `viaSender = new MessageSender(connection, "path", "via")`, 1. Path will now point to wherever the amqp-link is created to. 2. viaEntityPath will point to via entity. 3. TransferDestinationPath will point to the final destination of the message
- Loading branch information
Showing
3 changed files
with
69 additions
and
14 deletions.
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
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
46 changes: 46 additions & 0 deletions
46
sdk/servicebus/Microsoft.Azure.ServiceBus/tests/MessageSenderTests.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,46 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.Azure.ServiceBus.UnitTests | ||
{ | ||
using Core; | ||
using Xunit; | ||
|
||
public class MessageSenderTests | ||
{ | ||
private MessageSender viaSender; | ||
private MessageSender nonViaSender; | ||
|
||
public MessageSenderTests() | ||
{ | ||
var builder = new ServiceBusConnectionStringBuilder("blah.com", "path", "key-name", "key-value"); | ||
var connection = new ServiceBusConnection(builder); | ||
viaSender = new MessageSender(connection, "path", "via"); | ||
nonViaSender = new MessageSender(connection, "path"); | ||
} | ||
|
||
[Fact] | ||
[DisplayTestMethodName] | ||
public void Path_reflects_actual_link_destination() | ||
{ | ||
Assert.Equal("via", viaSender.Path); | ||
Assert.Equal("path", nonViaSender.Path); | ||
} | ||
|
||
[Fact] | ||
[DisplayTestMethodName] | ||
public void TransferDestinationPath_should_be_final_destination_name() | ||
{ | ||
Assert.Equal("path", viaSender.TransferDestinationPath); | ||
Assert.Null(nonViaSender.TransferDestinationPath); | ||
} | ||
|
||
[Fact] | ||
[DisplayTestMethodName] | ||
public void ViaEntityPath_should_be_via_entity_name() | ||
{ | ||
Assert.Equal("via", viaSender.ViaEntityPath); | ||
Assert.Null(nonViaSender.ViaEntityPath); | ||
} | ||
} | ||
} |