public void SortAllChildrenByPaths_Sorts_Top_Level_InRoot() { re.SortAllChildrenByPath(); Assert.That(re.Children[0].Path, Is.EqualTo("d2b")); //dirs first. Assert.That(re.Children[1].Path, Is.EqualTo("d2a")); Assert.That(re.Children[2].Path, Is.EqualTo("d2c")); }
public static void CreateCache(string path) { var re = new RootEntry(); try { re.SimpleScanCountEvent = ScanCountPrintDot; re.SimpleScanEndEvent = ScanEndofEntries; re.ExceptionEvent = PrintExceptions; re.PopulateRoot(path); if (Hack.BreakConsoleFlag) { Console.WriteLine(" * Break key detected incomplete scan will not be saved."); return; } var oldRoot = RootEntry.LoadDirCache(re.DefaultFileName); if (oldRoot != null) { Console.WriteLine($"Found cache \"{re.DefaultFileName}\""); Console.WriteLine("Updating hashs on new scan from found cache file."); oldRoot.TraverseTreesCopyHash(re); } re.SortAllChildrenByPath(); re.SaveRootEntry(); var scanTimeSpan = (re.ScanEndUTC - re.ScanStartUTC); Console.WriteLine($"Scanned Path {re.Path}"); Console.WriteLine($"Scan time {scanTimeSpan.TotalMilliseconds:0.00} msecs"); Console.WriteLine($"Saved Scanned Path {re.DefaultFileName}"); Console.WriteLine( $"Files {re.FileEntryCount:0,0} Dirs {re.DirEntryCount:0,0} Total Size of Files {re.Size:0,0}"); } catch (ArgumentException aex) { Console.WriteLine($"Error: {aex.Message}"); } }