当前位置: 首页>>代码示例>>C#>>正文


C# MockContext.GetServiceClient方法代码示例

本文整理汇总了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);
        }
开发者ID:Azure,项目名称:azure-powershell,代码行数:17,代码来源:TestController.cs

示例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;
 }
开发者ID:Azure,项目名称:azure-powershell,代码行数:8,代码来源:AdlaTestsBase.cs

示例3: GetDataLakeAnalyticsAccountManagementClient

 private DataLakeAnalyticsAccountManagementClient GetDataLakeAnalyticsAccountManagementClient(MockContext context)
 {
     return context.GetServiceClient<DataLakeAnalyticsAccountManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
 }
开发者ID:Azure,项目名称:azure-powershell,代码行数:4,代码来源:AdlaTestsBase.cs

示例4: GetNewResourceManagementClient

 private NewResourceManagementClient GetNewResourceManagementClient(MockContext context)
 {
     return context.GetServiceClient<NewResourceManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
 }
开发者ID:Azure,项目名称:azure-powershell,代码行数:4,代码来源:AdlaTestsBase.cs

示例5: GetKeyVaultManagementClient

 private KeyVaultManagementClient GetKeyVaultManagementClient(MockContext context)
 {
     return context.GetServiceClient<KeyVaultManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
 }
开发者ID:Azure,项目名称:azure-powershell,代码行数:4,代码来源:KeyVaultManagementController.cs

示例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;
 }
开发者ID:rohmano,项目名称:azure-powershell,代码行数:8,代码来源:AdlsTestsBase.cs

示例7: GetFeatureClient

 private FeatureClient GetFeatureClient(MockContext context)
 {
     return context.GetServiceClient<FeatureClient>(TestEnvironmentFactory.GetTestEnvironment());
 }
开发者ID:devigned,项目名称:azure-powershell,代码行数:4,代码来源:ResourcesController.cs

示例8: GetWebsitesManagementClient

 private WebSiteManagementClient GetWebsitesManagementClient(MockContext context)
 {
     return context.GetServiceClient<WebSiteManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
 }
开发者ID:Azure,项目名称:azure-powershell,代码行数:4,代码来源:WebsitesController.cs

示例9: GetPowerBIClient

 private PowerBIEmbeddedManagementClient GetPowerBIClient(MockContext context)
 {
     return context.GetServiceClient<PowerBIEmbeddedManagementClient>(Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory.GetTestEnvironment());
 }
开发者ID:Azure,项目名称:azure-powershell,代码行数:4,代码来源:PowerBIController.cs

示例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);
        }
开发者ID:FrankSiegemund,项目名称:azure-powershell,代码行数:21,代码来源:WebServicesTestController.cs

示例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());
        }
开发者ID:FrankSiegemund,项目名称:azure-powershell,代码行数:27,代码来源:BatchController.cs

示例12: GetNotificationHubsManagementClient

 protected NotificationHubsManagementClient GetNotificationHubsManagementClient(MockContext context)
 {
     return context.GetServiceClient<NotificationHubsManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
 }
开发者ID:Azure,项目名称:azure-powershell,代码行数:4,代码来源:TestBaseClass.cs

示例13: GetInsightsManagementClient

 private IInsightsManagementClient GetInsightsManagementClient(MockContext context)
 {
     //return TestBase.GetServiceClient<InsightsManagementClient>(this.csmTestFactory);
     return context.GetServiceClient<InsightsManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
 }
开发者ID:Azure,项目名称:azure-powershell,代码行数:5,代码来源:TestsController.cs

示例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);
        }
开发者ID:brnleehng,项目名称:azure-powershell,代码行数:26,代码来源:WebServicesTestController.cs

示例15: GetSubscriptionClient

 private SubscriptionClient GetSubscriptionClient(MockContext context)
 {
     return context.GetServiceClient<SubscriptionClient>(TestEnvironmentFactory.GetTestEnvironment());
 }
开发者ID:devigned,项目名称:azure-powershell,代码行数:4,代码来源:ResourcesController.cs


注:本文中的MockContext.GetServiceClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。