[Deps]Upgrade System.IO.Abstractions (#35656)

* Upgrade System.IO.Abstractions to the latest stable release
This commit is contained in:
Davide Giacometti
2024-11-11 10:42:40 +01:00
committed by GitHub
parent 3d306f6177
commit 2ea9d56129
22 changed files with 70 additions and 53 deletions

View File

@@ -51,7 +51,7 @@ namespace Microsoft.Plugin.Folder.UnitTests
[DataRow(@"c:", 2, 1, false, DisplayName = "Root without \\")]
[DataRow(@"c:\", 2, 1, false, DisplayName = "Normal root")]
[DataRow(@"c:\Test", 2, 2, false, DisplayName = "Select yourself")]
[DataRow(@"c:\not-exist", 2, 1, false, DisplayName = "Folder not exist, return root")]
[DataRow(@"c:\not-exist", 2, 0, false, DisplayName = "Folder not exist, return root")]
[DataRow(@"c:\not-exist\not-exist2", 0, 0, false, DisplayName = "Folder not exist, return root")]
[DataRow(@"c:\bla.t", 2, 1, false, DisplayName = "Partial match file")]
[DataRow(@"c:/bla.t", 2, 1, false, DisplayName = "Partial match file with /")]
@@ -88,8 +88,8 @@ namespace Microsoft.Plugin.Folder.UnitTests
[DataTestMethod]
[DataRow(@"c:\>", 3, 3, true, DisplayName = "Max Folder test recursive")]
[DataRow(@"c:\Test>", 3, 3, true, DisplayName = "2 Folders recursive")]
[DataRow(@"c:\not-exist>", 3, 3, true, DisplayName = "Folder not exist, return root recursive")]
[DataRow(@"c:\Test>", 3, 0, true, DisplayName = "2 Folders recursive")]
[DataRow(@"c:\not-exist>", 3, 0, true, DisplayName = "Folder not exist, return root recursive")]
[DataRow(@"c:\not-exist\not-exist2>", 0, 0, false, DisplayName = "Folder not exist, return root recursive")]
public void Query_Recursive_WhenCalled(string search, int folders, int files, bool truncated)
{

View File

@@ -25,7 +25,7 @@ namespace Microsoft.Plugin.Folder.Sources
public IEnumerable<DisplayFileInfo> MatchFileSystemInfo(string search, string incompleteName, bool isRecursive)
{
// search folder and add results
var directoryInfo = _directoryInfoFactory.FromDirectoryName(search);
var directoryInfo = _directoryInfoFactory.New(search);
var fileSystemInfos = directoryInfo.EnumerateFileSystemInfos(incompleteName, new EnumerationOptions
{
MatchType = _matchType,

View File

@@ -22,7 +22,7 @@ namespace Microsoft.Plugin.Program
public string Location { get; set; }
public string Name { get => name ?? FileSystem.DirectoryInfo.FromDirectoryName(Location).Name; set => name = value; }
public string Name { get => name ?? FileSystem.DirectoryInfo.New(Location).Name; set => name = value; }
public bool Enabled { get; set; } = true;

View File

@@ -71,8 +71,8 @@ namespace Wox.Infrastructure
}
else
{
var time1 = FileInfo.FromFileName(bundledDataPath).LastWriteTimeUtc;
var time2 = FileInfo.FromFileName(dataPath).LastWriteTimeUtc;
var time1 = FileInfo.New(bundledDataPath).LastWriteTimeUtc;
var time2 = FileInfo.New(dataPath).LastWriteTimeUtc;
if (time1 != time2)
{
File.Copy(bundledDataPath, dataPath, true);