public void MoveFolder_should_overright_existing_folder() { var diskProvider = new DiskProvider(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderMove.FullName); VerifyCopy(); //Act diskProvider.MoveDirectory(BinFolderCopy.FullName, BinFolderMove.FullName); //Assert VerifyMove(); }
public void CopyFolder_should_overright_existing_folder() { //Act var diskProvider = new DiskProvider(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); //Delete Random File BinFolderCopy.Refresh(); BinFolderCopy.GetFiles("*.*", SearchOption.AllDirectories).First().Delete(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); //Assert VerifyCopy(); }
public void CopyFolder_should_copy_folder() { //Act var diskProvider = new DiskProvider(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); //Assert VerifyCopy(); }
public void moveFile_should_not_move_overwrite_itself() { var diskProvider = new DiskProvider(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); var targetPath = BinFolderCopy.GetFiles("*.dll", SearchOption.AllDirectories).First().FullName; diskProvider.MoveFile(targetPath, targetPath); File.Exists(targetPath).Should().BeTrue(); ExceptionVerification.ExpectedWarns(1); }
public void moveFile_should_overwrite_existing_file() { var diskProvider = new DiskProvider(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); var targetPath = Path.Combine(BinFolderCopy.FullName, "file.move"); diskProvider.MoveFile(BinFolderCopy.GetFiles("*.dll", SearchOption.AllDirectories).First().FullName, targetPath); diskProvider.MoveFile(BinFolderCopy.GetFiles("*.dll", SearchOption.AllDirectories).First().FullName, targetPath); File.Exists(targetPath).Should().BeTrue(); }
public void moveFile_should_not_move_overwrite_itself() { var diskProvider = new DiskProvider(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); var targetPath = BinFolderCopy.GetFiles("*.dll", SearchOption.AllDirectories).First().FullName; diskProvider.MoveFile(targetPath, targetPath); File.Exists(targetPath).Should().BeTrue(); ExceptionVerification.ExpectedWarns(1); }
public void moveFile_should_overwrite_existing_file() { var diskProvider = new DiskProvider(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); var targetPath = Path.Combine(BinFolderCopy.FullName, "file.move"); diskProvider.MoveFile(BinFolderCopy.GetFiles("*.dll", SearchOption.AllDirectories).First().FullName, targetPath); diskProvider.MoveFile(BinFolderCopy.GetFiles("*.pdb", SearchOption.AllDirectories).First().FullName, targetPath); File.Exists(targetPath).Should().BeTrue(); }
public virtual void Start(string targetFolder) { Verify(targetFolder); AppType appType = AppType.Normal; logger.Info("Stopping all running services"); if (_serviceProvider.ServiceExist(ServiceProvider.NZBDRONE_SERVICE_NAME) && _serviceProvider.IsServiceRunning(ServiceProvider.NZBDRONE_SERVICE_NAME)) { appType = AppType.Service; _serviceProvider.Stop(ServiceProvider.NZBDRONE_SERVICE_NAME); } else { appType = AppType.Normal; } //TODO:Should be able to restart service if anything beyond this point fails logger.Info("Killing all running processes"); var processes = _processProvider.GetProcessByName(ProcessProvider.NzbDroneProccessName); foreach (var processInfo in processes) { _processProvider.Kill(processInfo.Id); } var consoleProcesses = _processProvider.GetProcessByName(ProcessProvider.NzbDroneConsoleProccessName); foreach (var processInfo in consoleProcesses) { appType = AppType.Console; _processProvider.Kill(processInfo.Id); } logger.Info("Killing all orphan IISExpress processes"); _iisProvider.StopServer(); logger.Info("Creating backup of existing installation"); _diskProvider.CopyDirectory(targetFolder, _environmentProvider.GetUpdateBackUpFolder()); logger.Info("Moving update package to target"); try { _diskProvider.CopyDirectory(_environmentProvider.GetUpdatePackageFolder(), targetFolder); logger.Trace("Deleting Update Package."); _diskProvider.DeleteFolder(_environmentProvider.GetUpdatePackageFolder(), true); } catch (Exception e) { RollBack(targetFolder); foreach (var key in e.Data.Keys) { logger.Trace("Key: {0}, Value: {1}", key, e.Data[key]); } logger.FatalException("Failed to copy upgrade package to target folder.", e); } finally { StartNzbDrone(appType, targetFolder); } }
public void CopyFolder_should_overright_existing_folder() { //Act var diskProvider = new DiskProvider(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); //Delete Random File BinFolderCopy.Refresh(); BinFolderCopy.GetFiles("*.*", SearchOption.AllDirectories).First().Delete(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); //Assert VerifyCopy(); }
public void CopyFolder_should_copy_folder() { //Act var diskProvider = new DiskProvider(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); //Assert VerifyCopy(); }
public void MoveFolder_should_overright_existing_folder() { var diskProvider = new DiskProvider(); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderCopy.FullName); diskProvider.CopyDirectory(BinFolder.FullName, BinFolderMove.FullName); VerifyCopy(); //Act diskProvider.MoveDirectory(BinFolderCopy.FullName, BinFolderMove.FullName); //Assert VerifyMove(); }