Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Fix NamespaceClient.GetNamespaceInfoAsync() #638

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,19 @@ private static NamespaceInfo ParseFromEntryElement(XElement xEntry)
case "Alias":
nsInfo.Alias = element.Value;
break;
case "MessagingUnits":
int.TryParse(element.Value, out var units);
nsInfo.MessagingUnits = units;
break;
case "NamespaceType":
if (Enum.TryParse<NamespaceType>(element.Value, out var nsType))
{
nsInfo.NamespaceType = nsType;
}
else if (element.Value == "Messaging") // TODO: workaround till next major as it's a breaking change
{
nsInfo.NamespaceType = NamespaceType.ServiceBus;
}
else
{
nsInfo.NamespaceType = NamespaceType.Others;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum NamespaceType

/// <summary>
/// Supported only for backward compatibility.
/// Namespace can contain mixture of messaging entities and notification hubs.
/// Namespace can contain mixture of messaging entities and notification hubs.
/// </summary>
Mixed = 2,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ public async Task GetNamespaceInfoTest()
{
var nsInfo = await client.GetNamespaceInfoAsync();
Assert.NotNull(nsInfo);
Assert.Equal(MessagingSku.Standard, nsInfo.MessagingSku); // Most CI systems generally use standard, hence this check just to ensure the API is working.
Assert.Equal(MessagingSku.Standard, nsInfo.MessagingSku); // Most CI systems generally use standard, hence this check just to ensure the API is working.
Assert.Equal(NamespaceType.ServiceBus, nsInfo.NamespaceType); // Common namespace type used for testing is messaging.
}

public void Dispose()
Expand Down