Esempio n. 1
0
        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");
        }
Esempio n. 2
0
        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");
        }
Esempio n. 3
0
        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");
        }
Esempio n. 4
0
        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");
        }
Esempio n. 5
0
 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));
     }
 }
Esempio n. 6
0
        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");
        }