Пример #1
0
 public static void AssertProfileUpdate(ProfileResource updatedProfile, PatchableProfileData updateOptions)
 {
     Assert.AreEqual(updatedProfile.Data.Tags.Count, updateOptions.Tags.Count);
     foreach (var kv in updatedProfile.Data.Tags)
     {
         Assert.True(updateOptions.Tags.ContainsKey(kv.Key));
         Assert.AreEqual(kv.Value, updateOptions.Tags[kv.Key]);
     }
 }
Пример #2
0
        public async Task Update()
        {
            SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync();

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

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

            PatchableProfileData updateOptions = new PatchableProfileData();

            updateOptions.Tags.Add("newTag", "newValue");
            var lro = await afdProfile.UpdateAsync(WaitUntil.Completed, updateOptions);

            ProfileResource updatedAfdProfile = lro.Value;

            ResourceDataHelper.AssertProfileUpdate(updatedAfdProfile, updateOptions);
        }