Skip to content

Commit

Permalink
Fix deletion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
d2dyno1 committed May 18, 2024
1 parent 3509f4d commit bc6070e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/System/IO/SystemFolderWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ private static IStorable CreateStorableFromPath(string path, bool minimalImpleme
return new SystemFile(path);
}

throw new ArgumentException($"Could not determine if the path '{path}' is a file or folder.");
// The item is most likely deleted. Return all available information through SimpleStorableItem
return new SimpleStorableItem(id: path, name: Path.GetFileName(path));
}

private static bool IsFile(string path) => Path.GetFileName(path) is { } str && str != string.Empty && File.Exists(path);
Expand Down
2 changes: 1 addition & 1 deletion tests/OwlCore.Storage.Tests/SystemIO/IFolderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public override Task<IModifiableFolder> CreateModifiableFolderAsync()
public override Task<IModifiableFolder> CreateModifiableFolderWithItems(int fileCount, int folderCount)
{
var tempFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
var dir = Directory.CreateDirectory(tempFolder);
_ = Directory.CreateDirectory(tempFolder);

for (var i = 0; i < fileCount; i++)
{
Expand Down

0 comments on commit bc6070e

Please sign in to comment.