Пример #1
0
        public void ExistingMachineSettingsFile_Multi_Works()
        {
            var strings = new string[]
            {
                ExistingMachineSettingsFile_Works_String,
                ExistingMachineSettingsFile_NoWorky_String
            };

            var file = VboxHelper.ExistingMachineSettingsFile(strings);

            Assert.IsFalse(string.IsNullOrWhiteSpace(file), "should have found file");
        }
Пример #2
0
        private void TryCreateVm(string vmName)
        {
            try
            {
                this.CreateVm(vmName);
            }
            catch (TestCreateVmException ex)
            {
                var machine = new TestMachine()
                {
                    Created = true,
                    HdFile  = string.Empty,
                    Name    = vmName
                };

                this.HaltMachine(machine, true);
                Thread.Sleep(3000);
                this.DestroyMachine(machine, true);

                var vmFile = VboxHelper.ExistingMachineSettingsFile(ex.ErrorLines);
                if (!string.IsNullOrWhiteSpace(vmFile))
                {
                    var vmFilePath = new FilePath(vmFile);
                    var dirPath    = vmFilePath.GetDirectory();
                    var fs         = CakeFixtures.CkFileSystem;
                    var file       = fs.GetFile(vmFilePath);
                    if (file.Exists)
                    {
                        file.Delete();
                    }

                    var dir = fs.GetDirectory(dirPath);
                    if (dir.Exists)
                    {
                        dir.Delete(true);
                    }
                }

                this.CreateVm(vmName);
            }
        }
Пример #3
0
        public void ExistingMachineSettingsFile_Single_NoWorky()
        {
            var file = VboxHelper.ExistingMachineSettingsFile(ExistingMachineSettingsFile_NoWorky_String);

            Assert.IsTrue(string.IsNullOrWhiteSpace(file), "should not have found file");
        }
Пример #4
0
        public void ExistingMachineSettingsFile_Single_Works()
        {
            var file = VboxHelper.ExistingMachineSettingsFile(ExistingMachineSettingsFile_Works_String);

            Assert.IsFalse(string.IsNullOrWhiteSpace(file), "should have found file");
        }