Skip to content

Commit 3f8e6e4

Browse files
author
unknown
committed
Resolve code review comments
1 parent 86429af commit 3f8e6e4

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/LocationTests.ps1

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ function Test-AzureLocation
2020
{
2121
$providerLocations = Get-AzureRmLocation
2222

23-
Assert-AreEqual 22 $providerLocations.Count
24-
25-
$eastAsiaLocation = $providerLocations[0]
26-
27-
Assert-AreEqual "eastasia" $eastAsiaLocation.Location
28-
Assert-AreEqual "East Asia" $eastAsiaLocation.DisplayName
29-
Assert-AreEqual 36 $eastAsiaLocation.Providers.Count
23+
Assert-True { $providerLocations.Count -gt 0 }
24+
foreach ($location in $providerLocations)
25+
{
26+
Assert-True { $location.Providers.Count -gt 0 }
27+
}
3028
}

src/ResourceManager/Resources/Commands.Resources/Providers/GetAzureLocationCmdlet.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public override void ExecuteCmdlet()
3939

4040
var allLocations = this.ResourcesClient.ListLocations(DefaultContext.Subscription.Id.ToString());
4141
var providers = this.ResourcesClient.ListResourceProviders(providerName: null, listAvailable: true);
42-
4342
var providerLocations = ConstructResourceProviderLocations(allLocations, providers);
4443

4544
this.WriteObject(providerLocations, enumerateCollection: true);
@@ -69,8 +68,7 @@ private List<PSResourceProviderLocation> ConstructResourceProviderLocations(List
6968

7069
private Dictionary<string, List<string>> GetLocationProviderMap(List<Provider> providers)
7170
{
72-
var locationMap = new Dictionary<string, List<string>>();
73-
71+
var locationMap = new Dictionary<string, List<string>>(StringComparer.InvariantCultureIgnoreCase);
7472
providers.CoalesceEnumerable()
7573
.ForEach(provider => AddResourceProvider(provider, locationMap));
7674

0 commit comments

Comments
 (0)