Esempio n. 1
0
        public async Task Usages()
        {
            SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync();

            ResourceGroupResource rg = await CreateResourceGroup(subscription, "testRg-");

            string          afdProfileName = Recording.GenerateAssetName("AFDProfile-");
            ProfileResource afdProfile     = await CreateAfdProfile(rg, afdProfileName, CdnSkuName.StandardAzureFrontDoor);

            string afdEndpointName = Recording.GenerateAssetName("AFDEndpoint-");
            FrontDoorEndpointResource afdEndpointInstance = await CreateAfdEndpoint(afdProfile, afdEndpointName);

            int count = 0;

            await foreach (var tempUsage in afdEndpointInstance.GetResourceUsagesAsync())
            {
                count++;
                Assert.AreEqual(tempUsage.CurrentValue, 0);
                Assert.AreEqual(tempUsage.Unit, UsageUnit.Count);
            }
            Assert.AreEqual(count, 1);
        }