public void LocationCombinesPathAndNameCorrectly() { string path = "C:/Test/disks"; string name = "mydisk"; string extension = "vhd"; string location = path + "/" + name + "." + extension; VirtualDisk vd = VirtualDisk.FromPath(location); Assert.True(vd.Location == location, "Location was not combined correclty"); }
public void FromPathParsesName() { string path = "C:\\Test\\disks"; string name = "mydisk"; string extension = "vhd"; string absolutePath = path + "\\" + name + "." + extension; VirtualDisk vd = VirtualDisk.FromPath(absolutePath); Assert.True(vd.Name == name, "Name was not parsed from path correclty"); }
public void FromPathParsesExtension() { string path = "C:/Test/disks"; string name = "mydisk"; string extension = "vhd"; string location = path + "/" + name + "." + extension; VirtualDisk vd = VirtualDisk.FromPath(location); Assert.True(vd.Extension == extension, "Extension was not combined correclty"); }
public void FromPathParsesPath() { string path = "C:/Test/disks"; string name = "mydisk"; string extension = "vhd"; string absolutePath = path + "/" + name + "." + extension; VirtualDisk vd = VirtualDisk.FromPath(absolutePath); Assert.True(vd.Path == path, "Path was not property parsed"); }
private VirtualMachine(Guid id, string name, List <string> vhdPaths) { Id = id; Name = name; VirtualDisks = new List <VirtualDisk>(); foreach (string vhdPath in vhdPaths) { VirtualDisks.Add(VirtualDisk.FromPath(vhdPath)); } }
public void FromPathReplacesWindowsNotation() { string path = "C:/Test/disks"; string windowsPath = path.Replace("/", "\\"); string name = "mydisk"; string extension = "vhd"; string absolutePath = windowsPath + "\\" + name + "." + extension; VirtualDisk vd = VirtualDisk.FromPath(absolutePath); Assert.True(vd.Path == path, "Path was not property parsed"); }