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"); }
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); } }
public void ExistingMachineSettingsFile_Single_NoWorky() { var file = VboxHelper.ExistingMachineSettingsFile(ExistingMachineSettingsFile_NoWorky_String); Assert.IsTrue(string.IsNullOrWhiteSpace(file), "should not have found file"); }
public void ExistingMachineSettingsFile_Single_Works() { var file = VboxHelper.ExistingMachineSettingsFile(ExistingMachineSettingsFile_Works_String); Assert.IsFalse(string.IsNullOrWhiteSpace(file), "should have found file"); }