File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 18
18
using System . Net ;
19
19
using System . Net . Http ;
20
20
using System . Net . Http . Headers ;
21
- using Hyak . Common ;
22
21
using Microsoft . Azure . Commands . Common . Authentication ;
23
22
using Microsoft . Azure . Commands . Common . Authentication . Abstractions ;
24
23
using Microsoft . Azure . Commands . Common . Authentication . Models ;
25
- using Microsoft . Azure . Graph . RBAC . Version1_6 ;
26
- using Microsoft . Rest ;
27
24
using Microsoft . Rest . ClientRuntime . Azure . TestFramework ;
28
25
#if NETSTANDARD
29
26
using Microsoft . Azure . Commands . Common . Authentication . Abstractions . Core ;
@@ -42,13 +39,9 @@ public TestClientFactory(MockContext mockContext)
42
39
43
40
public TClient CreateArmClient < TClient > ( IAzureContext context , string endpoint ) where TClient : Rest . ServiceClient < TClient >
44
41
{
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 > ( ) ;
52
45
}
53
46
54
47
public TClient CreateCustomArmClient < TClient > ( params object [ ] parameters ) where TClient : Rest . ServiceClient < TClient >
You can’t perform that action at this time.
0 commit comments