本文整理汇总了C#中OS.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# OS.ToString方法的具体用法?C# OS.ToString怎么用?C# OS.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OS
的用法示例。
在下文中一共展示了OS.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddAzureVMImageCmdletInfo
public AddAzureVMImageCmdletInfo(string imageName, string mediaLocation, OS os, string label)
{
cmdletName = Utilities.AddAzureVMImageCmdletName;
cmdletParams.Add(new CmdletParam("ImageName", imageName));
cmdletParams.Add(new CmdletParam("MediaLocation", mediaLocation));
cmdletParams.Add(new CmdletParam("OS", os.ToString()));
if (!string.IsNullOrEmpty(label))
{
cmdletParams.Add(new CmdletParam("Label", label));
}
}
示例2: VerifyVM
public void VerifyVM(PersistentVM vm, OS ImageFamily, HostCaching hostCaching, int LogicalDiskSizeInGB, int noOfDataDisks)
{
//Verify OS Disk
Console.WriteLine("VM OS Virtual Hard Disk properties:");
Utilities.PrintContext(vm.OSVirtualHardDisk);
Assert.AreEqual(HostCaching.ReadWrite.ToString(), vm.OSVirtualHardDisk.HostCaching, "Os disk Property HostCaching is not matching.");
Assert.AreEqual(ImageFamily.ToString(), vm.OSVirtualHardDisk.OS,"ImageFamily property is not matching.");
//Verify Data Disk
Console.WriteLine("VM Data Hard Disk properties:");
Utilities.PrintContext(vm.DataVirtualHardDisks[0]);
Assert.AreEqual(hostCaching.ToString(), vm.DataVirtualHardDisks[0].HostCaching, "Data disk Property HostCaching is not matching.");
Assert.AreEqual(LogicalDiskSizeInGB, vm.DataVirtualHardDisks[0].LogicalDiskSizeInGB,"Data disk size is not matching.");
Assert.AreEqual(noOfDataDisks, vm.DataVirtualHardDisks.Count, "Data disks count is not matching.");
}
示例3: VerifyVMImage
public void VerifyVMImage(string vmImageName, OS ImageFamily, string imageLabel, string osState, HostCaching hostCaching, DataDiskConfigurationList diskConfigs)
{
var vmImages = vmPowershellCmdlets.GetAzureVMImageReturningVMImages(vmImageName);
Assert.IsTrue(vmImages.Count >= 1);
var vmImageInfo = vmImages[0];
Utilities.PrintContext(vmImageInfo);
Utilities.PrintContext(vmImageInfo.OSDiskConfiguration);
foreach (var disk in vmImageInfo.DataDiskConfigurations)
{
Utilities.PrintContext(disk);
}
//Verify ImageName
Assert.IsTrue(vmImageName.Equals(vmImageInfo.ImageName));
Assert.IsTrue(vmImageInfo.Label.Equals(imageLabel));
//Verify Category
Assert.IsTrue("User".Equals(vmImageInfo.Category, StringComparison.CurrentCultureIgnoreCase));
//Verify LogicalDiskSizeInGB, HostCaching
Assert.AreEqual(hostCaching.ToString(), vmImageInfo.OSDiskConfiguration.HostCaching, "Property HostCaching is not matching.");
//Verify the no of the data disks
Assert.AreEqual(diskConfigs.Count, vmImageInfo.DataDiskConfigurations.Count);
//Verify Data disks.
VerifyDataDiskConfiguration(diskConfigs, vmImageInfo);
//Verify OSstate
Assert.AreEqual(osState, vmImageInfo.OSDiskConfiguration.OSState, "OsState is not matching.");
//Verify OS
Assert.AreEqual(ImageFamily.ToString(), vmImageInfo.OSDiskConfiguration.OS, "Os Family is not matching.");
}