예제 #1
0
 public async Task Cleanup()
 {
     if (resourceGroupClient != null)
     {
         await resourceGroupClient.StartDeleteAsync(resourceGroupName);
     }
 }
        public async Task DnsListZonesInSubscription()
        {
            string zoneNameOne = "dns.zoneonename.io";
            string zoneNameTwo = "dns.zonetwoname.io";
            var    aZone       = new Zone("Global");
            await ZonesOperations.CreateOrUpdateAsync(resourceGroup, zoneNameOne, aZone);

            aZone = new Zone("Global");
            await ZonesOperations.CreateOrUpdateAsync(resourceGroup, zoneNameTwo, aZone);

            await Helper.TryRegisterResourceGroupAsync(ResourceGroupsOperations, this.location, this.resourceGroup + "-Two");

            var response     = ZonesOperations.ListAsync();
            var totalList    = response.ToEnumerableAsync().Result;
            var zoneOneFound = false;
            var zoneTwoFound = false;

            foreach (var zone in totalList)
            {
                if (zone.Name == zoneNameOne)
                {
                    zoneOneFound = true;
                }
                else if (zone.Name == zoneNameTwo)
                {
                    zoneTwoFound = true;
                }
            }
            Assert.IsTrue(zoneOneFound && zoneTwoFound);
            await ResourceGroupsOperations.StartDeleteAsync(this.resourceGroup + "-Two");

            await ZonesOperations.StartDeleteAsync(resourceGroup, zoneNameOne);
        }
예제 #3
0
        public static async Task DeleteResourceGroup(string rgName)
        {
            Utilities.Log("Deleting resource group: " + rgName);

            await(await ResourceGroups.StartDeleteAsync(rgName)).WaitForCompletionAsync();

            Utilities.Log("Deleted resource group: " + rgName);
        }
예제 #4
0
        public async Task Cleanup()
        {
            //foreach (var tempDir in _tempDirs)
            //{
            //    tempDir.Delete(true);
            //}

            await _resourceGroupClient.StartDeleteAsync(_resourceGroupName);
        }
예제 #5
0
        public async Task CleanupCode()
        {
            if (resourceGroupClient != null)
            {
                await resourceGroupClient.StartDeleteAsync(resourceGroupName);
            }

            //foreach (var tempDir in _tempDirs)
            //{
            //    if(tempDir.Exists)
            //        tempDir.Delete(true);
            //}
        }
        public async Task DeleteResourceGroupRemovesGroup()
        {
            var resourceGroupName = Recording.GenerateAssetName("csmrg");
            var createResult      = await ResourceGroupsOperations.CreateOrUpdateAsync(resourceGroupName, new ResourceGroup(DefaultLocation));

            var getResult = await ResourceGroupsOperations.GetAsync(resourceGroupName);

            var rawDeleteResult = await ResourceGroupsOperations.StartDeleteAsync(resourceGroupName);

            var deleteResult = (await WaitForCompletionAsync(rawDeleteResult)).Value;
            var listResult   = await ResourceGroupsOperations.ListAsync(null).ToEnumerableAsync();

            Assert.AreEqual(200, deleteResult.Status);
            foreach (var rg in listResult)
            {
                if (rg.Name == resourceGroupName)
                {
                    Assert.AreNotEqual("Deleting", rg.Properties.ProvisioningState);
                }
            }
        }
 public async Task CleanupCode()
 {
     await resourceGroupClient.StartDeleteAsync(resourceGroupName);
 }