本文整理汇总了C#中MockContext.GetServiceClient方法的典型用法代码示例。如果您正苦于以下问题:C# MockContext.GetServiceClient方法的具体用法?C# MockContext.GetServiceClient怎么用?C# MockContext.GetServiceClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MockContext
的用法示例。
在下文中一共展示了MockContext.GetServiceClient方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupManagementClients
protected void SetupManagementClients(MockContext context)
{
ResourceManagementClient = TestBase.GetServiceClient<ResourceManagementClient>(_csmTestFactory);
SubscriptionClient = TestBase.GetServiceClient<SubscriptionClient>(_csmTestFactory);
GalleryClient = TestBase.GetServiceClient<GalleryClient>(_csmTestFactory);
AuthorizationManagementClient = TestBase.GetServiceClient<AuthorizationManagementClient>(_csmTestFactory);
StorageManagementClient = TestBase.GetServiceClient<StorageManagementClient>(_csmTestFactory);
MediaServicesManagementClient = context.GetServiceClient<MediaServicesManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
_helper.SetupManagementClients(
ResourceManagementClient,
SubscriptionClient,
StorageManagementClient,
GalleryClient,
AuthorizationManagementClient,
MediaServicesManagementClient);
}
示例2: GetDataLakeAnalyticsCatalogManagementClient
private DataLakeAnalyticsCatalogManagementClient GetDataLakeAnalyticsCatalogManagementClient(MockContext context)
{
var currentEnvironment = TestEnvironmentFactory.GetTestEnvironment();
var toReturn = context.GetServiceClient<DataLakeAnalyticsCatalogManagementClient>(currentEnvironment, true);
toReturn.AdlaCatalogDnsSuffix =
currentEnvironment.Endpoints.DataLakeAnalyticsJobAndCatalogServiceUri.OriginalString.Replace("https://", "");
return toReturn;
}
示例3: GetDataLakeAnalyticsAccountManagementClient
private DataLakeAnalyticsAccountManagementClient GetDataLakeAnalyticsAccountManagementClient(MockContext context)
{
return context.GetServiceClient<DataLakeAnalyticsAccountManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}
示例4: GetNewResourceManagementClient
private NewResourceManagementClient GetNewResourceManagementClient(MockContext context)
{
return context.GetServiceClient<NewResourceManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}
示例5: GetKeyVaultManagementClient
private KeyVaultManagementClient GetKeyVaultManagementClient(MockContext context)
{
return context.GetServiceClient<KeyVaultManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}
示例6: GetDataLakeStoreFileSystemManagementClient
private DataLakeStoreFileSystemManagementClient GetDataLakeStoreFileSystemManagementClient(MockContext context)
{
var currentEnvironment = TestEnvironmentFactory.GetTestEnvironment();
var toReturn = context.GetServiceClient<DataLakeStoreFileSystemManagementClient>(currentEnvironment, true);
toReturn.AdlsFileSystemDnsSuffix =
currentEnvironment.Endpoints.DataLakeStoreServiceUri.OriginalString.Replace("https://", "");
return toReturn;
}
示例7: GetFeatureClient
private FeatureClient GetFeatureClient(MockContext context)
{
return context.GetServiceClient<FeatureClient>(TestEnvironmentFactory.GetTestEnvironment());
}
示例8: GetWebsitesManagementClient
private WebSiteManagementClient GetWebsitesManagementClient(MockContext context)
{
return context.GetServiceClient<WebSiteManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}
示例9: GetPowerBIClient
private PowerBIEmbeddedManagementClient GetPowerBIClient(MockContext context)
{
return context.GetServiceClient<PowerBIEmbeddedManagementClient>(Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory.GetTestEnvironment());
}
示例10: SetupManagementClients
private void SetupManagementClients(MockContext context)
{
this.ResourceManagementClient =
LegacyTest.TestBase.GetServiceClient<ResourceManagementClient>(this.csmTestFactory);
this.WebServicesManagementClient =
context.GetServiceClient<AzureMLWebServicesManagementClient>(
TestEnvironmentFactory.GetTestEnvironment());
this.StorageManagementClient = LegacyTest.TestBase.GetServiceClient<StorageManagementClient>(this.csmTestFactory);
var subscriptionClient = LegacyTest.TestBase.GetServiceClient<SubscriptionClient>(this.csmTestFactory);
var authManagementClient = LegacyTest.TestBase.GetServiceClient<AuthorizationManagementClient>(this.csmTestFactory);
var gallleryClient = LegacyTest.TestBase.GetServiceClient<GalleryClient>(this.csmTestFactory);
HttpClientHelperFactory.Instance = new TestHttpClientHelperFactory(
this.csmTestFactory.GetTestEnvironment().Credentials as SubscriptionCloudCredentials);
helper.SetupManagementClients(this.ResourceManagementClient,
subscriptionClient,
this.WebServicesManagementClient,
authManagementClient,
gallleryClient,
this.StorageManagementClient);
}
示例11: GetBatchManagementClient
private BatchManagementClient GetBatchManagementClient(MockContext context)
{
if (HttpMockServer.Mode == HttpRecorderMode.Record)
{
BatchAccount = Environment.GetEnvironmentVariable(ScenarioTestHelpers.BatchAccountName);
BatchAccountKey = Environment.GetEnvironmentVariable(ScenarioTestHelpers.BatchAccountKey);
BatchAccountUrl = Environment.GetEnvironmentVariable(ScenarioTestHelpers.BatchAccountEndpoint);
BatchResourceGroup = Environment.GetEnvironmentVariable(ScenarioTestHelpers.BatchAccountResourceGroup);
HttpMockServer.Variables[ScenarioTestHelpers.BatchAccountName] = BatchAccount;
HttpMockServer.Variables[ScenarioTestHelpers.BatchAccountEndpoint] = BatchAccountUrl;
HttpMockServer.Variables[ScenarioTestHelpers.BatchAccountResourceGroup] = BatchResourceGroup;
}
else if (HttpMockServer.Mode == HttpRecorderMode.Playback)
{
BatchAccount = HttpMockServer.Variables[ScenarioTestHelpers.BatchAccountName];
BatchAccountKey = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000==";
BatchAccountUrl = HttpMockServer.Variables[ScenarioTestHelpers.BatchAccountEndpoint];
if (HttpMockServer.Variables.ContainsKey(ScenarioTestHelpers.BatchAccountResourceGroup))
{
BatchResourceGroup = HttpMockServer.Variables[ScenarioTestHelpers.BatchAccountResourceGroup];
}
}
return context.GetServiceClient<BatchManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}
示例12: GetNotificationHubsManagementClient
protected NotificationHubsManagementClient GetNotificationHubsManagementClient(MockContext context)
{
return context.GetServiceClient<NotificationHubsManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}
示例13: GetInsightsManagementClient
private IInsightsManagementClient GetInsightsManagementClient(MockContext context)
{
//return TestBase.GetServiceClient<InsightsManagementClient>(this.csmTestFactory);
return context.GetServiceClient<InsightsManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}
示例14: SetupManagementClients
private void SetupManagementClients(MockContext context)
{
this.ResourceManagementClient =
LegacyTest.TestBase.GetServiceClient<ResourceManagementClient>(this.csmTestFactory);
this.WebServicesManagementClient =
context.GetServiceClient<AzureMLWebServicesManagementClient>(
TestEnvironmentFactory.GetTestEnvironment());
this.StorageManagementClient = LegacyTest.TestBase.GetServiceClient<StorageManagementClient>(this.csmTestFactory);
var subscriptionClient = LegacyTest.TestBase.GetServiceClient<SubscriptionClient>(this.csmTestFactory);
var authManagementClient = LegacyTest.TestBase.GetServiceClient<AuthorizationManagementClient>(this.csmTestFactory);
var gallleryClient = LegacyTest.TestBase.GetServiceClient<GalleryClient>(this.csmTestFactory);
var testEnvironment = this.csmTestFactory.GetTestEnvironment();
var credentials = new SubscriptionCredentialsAdapter(
testEnvironment.AuthorizationContext.TokenCredentials[Microsoft.Azure.Test.TokenAudience.Management],
testEnvironment.SubscriptionId);
HttpClientHelperFactory.Instance = new TestHttpClientHelperFactory(
credentials);
helper.SetupManagementClients(this.ResourceManagementClient,
subscriptionClient,
this.WebServicesManagementClient,
authManagementClient,
gallleryClient,
this.StorageManagementClient);
}
示例15: GetSubscriptionClient
private SubscriptionClient GetSubscriptionClient(MockContext context)
{
return context.GetServiceClient<SubscriptionClient>(TestEnvironmentFactory.GetTestEnvironment());
}