Skip to content

Commit 869516c

Browse files
committed
Resolve review comment
1 parent 0ed4382 commit 869516c

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

tools/TestFx/TestClientFactory.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@
1818
using System.Net;
1919
using System.Net.Http;
2020
using System.Net.Http.Headers;
21-
using Hyak.Common;
2221
using Microsoft.Azure.Commands.Common.Authentication;
2322
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
2423
using Microsoft.Azure.Commands.Common.Authentication.Models;
25-
using Microsoft.Azure.Graph.RBAC.Version1_6;
26-
using Microsoft.Rest;
2724
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
2825
#if NETSTANDARD
2926
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
@@ -42,13 +39,9 @@ public TestClientFactory(MockContext mockContext)
4239

4340
public TClient CreateArmClient<TClient>(IAzureContext context, string endpoint) where TClient : Rest.ServiceClient<TClient>
4441
{
45-
if (typeof(TClient).Name != typeof(GraphRbacManagementClient).Name)
46-
{
47-
return _mockContext.GetServiceClient<TClient>();
48-
}
49-
50-
var graphClient = _mockContext.GetGraphServiceClient<TClient>();
51-
return graphClient as TClient;
42+
return string.Equals(endpoint, AzureEnvironment.Endpoint.Graph, StringComparison.OrdinalIgnoreCase) ?
43+
_mockContext.GetGraphServiceClient<TClient>() :
44+
_mockContext.GetServiceClient<TClient>();
5245
}
5346

5447
public TClient CreateCustomArmClient<TClient>(params object[] parameters) where TClient : Rest.ServiceClient<TClient>

0 commit comments

Comments
 (0)