private void SetupManagementClients(MockContext context) { ResourceManagementClient = GetResourceManagementClient(context); MapsClient = GetMapsManagementClient(context); _helper.SetupManagementClients( ResourceManagementClient, MapsClient); }
public static string CreateDefaultMapsAccount(MapsManagementClient mapsManagementClient, string rgname) { var accountName = TestUtilities.GenerateName("maps"); var parameters = GetDefaultMapsAccountParameters(); var newAccount = mapsManagementClient.Accounts.CreateOrUpdate(rgname, accountName, parameters); VerifyAccountProperties(newAccount, true); return(accountName); }
public static MapsManagementClient GetMapsManagementClient(MockContext context, RecordedDelegatingHandler handler) { MapsManagementClient mapsClient; if (IsTestTenant) { mapsClient = new MapsManagementClient(new TokenCredentials("xyz"), GetHandler()) { SubscriptionId = TestSubscription, BaseUri = TestUri }; } else { handler.IsPassThrough = true; mapsClient = context.GetServiceClient <MapsManagementClient>(handlers: handler); } return(mapsClient); }