public static GetResourceManagementClient ( ) : Microsoft.Azure.Management.Resources.ResourceManagementClient | ||
리턴 | Microsoft.Azure.Management.Resources.ResourceManagementClient |
public TestsFixture() { // place any initialization like environment settings here #if DEBUG //Environment.SetEnvironmentVariable("AZURE_TEST_MODE", "Record"); //Environment.SetEnvironmentVariable( // "TEST_CSM_ORGID_AUTHENTICATION", // "SubscriptionId=;Environment=;AADTenant="); //Environment.SetEnvironmentVariable( // "TEST_ORGID_AUTHENTICATION", // "SubscriptionId=;Environment="); #endif TestUtilities.StartTest(); try { UndoContext.Current.Start(); var resourceManagementClient = ApiManagementHelper.GetResourceManagementClient(); resourceManagementClient.TryRegisterSubscriptionForResource(); } catch (Exception) { Cleanup(); throw; } finally { TestUtilities.EndTest(); } }
public TestsFixture() { // Initialize has bug which causes null reference exception HttpMockServer.FileSystemUtilsObject = new FileSystemUtils(); TestUtilities.StartTest(); using (MockContext context = MockContext.Start(TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName(2))) { var resourceManagementClient = ApiManagementHelper.GetResourceManagementClient(); resourceManagementClient.TryRegisterSubscriptionForResource(); } }
public TestsFixture() { // Initialize has bug which causes null reference exception HttpMockServer.FileSystemUtilsObject = new FileSystemUtils(); var sf = new StackTrace().GetFrame(1); var callingClassType = sf.GetMethod().ReflectedType?.ToString(); var mockName = sf.GetMethod().Name; using (var context = MockContext.Start(callingClassType, mockName)) { var resourceManagementClient = ApiManagementHelper.GetResourceManagementClient(context); resourceManagementClient.TryRegisterSubscriptionForResource(); } }
public ApiManagementTestsFixture() { using (MockContext context = MockContext.Start("ApiManagementTests", "CreateApiManagementService")) { var resourceManagementClient = ApiManagementHelper.GetResourceManagementClient(); ResourceGroupName = "powershelltest"; Location = "West US"; if (string.IsNullOrWhiteSpace(ResourceGroupName)) { ResourceGroupName = Azure.Test.TestUtilities.GenerateName("Api-Default"); resourceManagementClient.TryRegisterResourceGroup(Location, ResourceGroupName); } ApiManagementServiceName = "powershellsdkservice"; ApiManagementHelper.GetApiManagementClient(context).TryCreateApiService(ResourceGroupName, ApiManagementServiceName, Location); } }
public ApiManagementTests(Xunit.Abstractions.ITestOutputHelper output) : base(output) { using (var context = MockContext.Start("ApiManagementTests", "CreateApiManagementService")) { var resourceManagementClient = ApiManagementHelper.GetResourceManagementClient(context); ResourceGroupName = "Apim-NetSdk-20210801"; Location = "CentralUSEUAP"; if (string.IsNullOrWhiteSpace(ResourceGroupName)) { ResourceGroupName = TestUtilities.GenerateName("Api-Default"); resourceManagementClient.TryRegisterResourceGroup(Location, ResourceGroupName); } ApiManagementServiceName = "powershellsdkservicetest"; ApiManagementHelper.GetApiManagementClient(context).TryCreateApiService(ResourceGroupName, ApiManagementServiceName, Location); } }
public TestsFixture() { // Initialize has bug which causes null reference exception HttpMockServer.FileSystemUtilsObject = new FileSystemUtils(); TestUtilities.StartTest(); try { UndoContext.Current.Start(); var resourceManagementClient = ApiManagementHelper.GetResourceManagementClient(); resourceManagementClient.TryRegisterSubscriptionForResource(); } catch (Exception) { Cleanup(); throw; } finally { TestUtilities.EndTest(); } }
public ApiManagementTests(Xunit.Abstractions.ITestOutputHelper output) { _helper = new EnvironmentSetupHelper { TracingInterceptor = new XunitTracingInterceptor(output) }; XunitTracingInterceptor.AddToContext(_helper.TracingInterceptor); using (var context = MockContext.Start("ApiManagementTests", "CreateApiManagementService")) { var resourceManagementClient = ApiManagementHelper.GetResourceManagementClient(context); ResourceGroupName = "powershelltest"; Location = "West US"; if (string.IsNullOrWhiteSpace(ResourceGroupName)) { ResourceGroupName = TestUtilities.GenerateName("Api-Default"); resourceManagementClient.TryRegisterResourceGroup(Location, ResourceGroupName); } ApiManagementServiceName = "powershellsdkservice"; ApiManagementHelper.GetApiManagementClient(context).TryCreateApiService(ResourceGroupName, ApiManagementServiceName, Location); } }