private void VerifyDataDiskConfiguration(DataDiskConfigurationList dataDiskConfigs, VMImageContext vmImageInfo)
 {
     try
     {
         for (int i = 0; i < dataDiskConfigs.Count; i++)
         {
             Assert.AreEqual(dataDiskConfigs[i].HostCaching.ToString(), vmImageInfo.DataDiskConfigurations[i].HostCaching, "Data disk HostCaching iproperty is not matching.");
             //Verify LogicalDiskSizeInGB,
             Assert.AreEqual(dataDiskConfigs[i].LogicalDiskSizeInGB, vmImageInfo.DataDiskConfigurations[i].LogicalDiskSizeInGB);
             //Verify  LUN
             Assert.AreEqual(dataDiskConfigs[i].Lun, vmImageInfo.DataDiskConfigurations[i].Lun);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
         throw ex;
     }
 }
        private void UpdateAzureVMImageDetails(string imageName)
        {
            VMImageContext imageContext = new VMImageContext()
            {
                Eula = "End user licensce agreement value",
                ImageFamily = OS.Windows.ToString(),
                Description = "Description",
                IconUri = "IconName",
                ImageName = imageName,
                Label = imageName,
                Language = "English",
                PrivacyUri = new Uri(@"http://www.bing.com"),
                PublishedDate = DateTime.Now,
                RecommendedVMSize = InstanceSize.Medium.ToString(),
                ShowInGui = false,
                SmallIconUri = "SmallIconName",
            };

            Utilities.ExecuteAndLog(() =>
                {
                    vmPowershellCmdlets.UpdateAzureVMImage(imageName, imageName, imageContext.ImageFamily, imageContext.ShowInGui.Value, imageContext.RecommendedVMSize, imageContext.Description, imageContext.Eula,
                         imageContext.PrivacyUri, imageContext.PublishedDate, imageContext.Language, imageContext.IconName, imageContext.SmallIconName);
                }, "Update Azure VM Image details");

            VerifyVMImageProperties(imageContext);
        }
        private void VerifyVMImageProperties(VMImageContext imageContext)
        {
            Utilities.ExecuteAndLog(() =>
                {
                    var vmImages = vmPowershellCmdlets.GetAzureVMImageReturningVMImages(imageContext.ImageName);
                    var vmImageContext = vmImages[0];

                    Utilities.PrintContext(vmImageContext);

                    Console.WriteLine("\n Verification:");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.Eula, vmImageContext.Eula), "Eula");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.Description, vmImageContext.Description), "Description");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.IconUri, vmImageContext.IconUri), "IconUri");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.IconName, vmImageContext.IconName), "IconName");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.ImageFamily, vmImageContext.ImageFamily), "ImageFamily");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.ImageName, vmImageContext.ImageName), "ImageName");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.Label, vmImageContext.Label), "Label");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.Language, vmImageContext.Language), "Language");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.PrivacyUri, vmImageContext.PrivacyUri), "PrivacyUri");
                    Utilities.LogAssert(() => Assert.IsTrue(imageContext.PublishedDate.Value.Date.Equals(vmImageContext.PublishedDate.Value.Date)), "PublishedDate");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.RecommendedVMSize, vmImageContext.RecommendedVMSize), "RecommendedVMSize");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.ShowInGui, vmImageContext.ShowInGui), "ShowInGui");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.SmallIconUri, vmImageContext.SmallIconUri), "SmallIconUri");
                    Utilities.LogAssert(() => Assert.AreEqual(imageContext.SmallIconName, vmImageContext.SmallIconName), "SmallIconName");
                }, "Verify VM image details");
        }
 public GetAzureVMImageDiskConfigSetCmdletInfo(VMImageContext imageContext)
 {
     this.cmdletName = Utilities.GetAzureVMImageDiskConfigSetCmdletName;
     this.cmdletParams.Add(new CmdletParam("ImageContext",imageContext));
 }