public IFolderDiff Build(ISyncPair syncPair) { IsNotNull(syncPair); var diffInfo = _diffInfoBuilder.BuildInfo(syncPair); diffInfo.Destination.EnsureExists(); if (!diffInfo.Source.Exists) { throw new NodeNotFoundException(); } _fileScanner.FileFound += _fileScanner_SourceFileFound; var sourceScan = _fileScanner.Scan(diffInfo.Source); _fileScanner.FileFound -= _fileScanner_SourceFileFound; _fileScanner.FileFound += _fileScanner_DestinationFileFound; var destinationScan = _fileScanner.Scan(diffInfo.Destination); _fileScanner.FileFound -= _fileScanner_DestinationFileFound; return(_folderDiffer.BuildDiff(sourceScan, destinationScan)); }
public IDiffInfo BuildInfo(ISyncPair syncPair) { var source = syncPair.Source; var destination = syncPair.Destination; if (syncPair.Level == SyncLevel.Parent) { destination = Path.Combine(destination, new KoreFolderInfo(syncPair.Source).Name); } return(new DiffInfo { Source = new KoreFolderInfo(source), Destination = new KoreFolderInfo(destination) }); }
private void SetupCurrentTestFolder(string testFolder, SyncLevel syncLevel = SyncLevel.Flat) { _currentTest = Path.Combine(CurrentWorkingFolder, testFolder); _sourceFolder = Path.Combine(_currentTest, "src"); _destinationFolder = Path.Combine(_currentTest, "dest"); EnsureFolderExists(_sourceFolder); EnsureFolderExists(_destinationFolder); _syncPair = new SyncPair { Source = _sourceFolder, Destination = _destinationFolder, Level = syncLevel }; _kontrol.Settings.SyncPairs.Add(_syncPair); }
private IFolderDiffResult BuildFolderDiffResult(ISyncPair syncPair) { return(new FolderDiffResult(syncPair, _diffBuilder.Build(syncPair))); }
public FolderDiffResult(ISyncPair syncPair, IFolderDiff folderDiff) { SyncPair = syncPair; FolderDiff = folderDiff; }