New: Ignore inaccessible files with getting files

(cherry picked from commit e5aa8584100d96a2077c57f74ae5b2ceab63de19)
This commit is contained in:
Mark McDowall
2023-08-03 19:54:44 -07:00
committed by Bogdan
parent 03c93c9c84
commit 331d0c9a9c
28 changed files with 111 additions and 78 deletions
@@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using FluentAssertions;
using Moq;
using NUnit.Framework;
@@ -25,7 +25,7 @@ namespace NzbDrone.Mono.Test.EnvironmentInfo.VersionAdapters
.Setup(c => c.FolderExists("/System/Library/CoreServices/")).Returns(true);
Mocker.GetMock<IDiskProvider>()
.Setup(c => c.GetFiles("/System/Library/CoreServices/", SearchOption.TopDirectoryOnly))
.Setup(c => c.GetFiles("/System/Library/CoreServices/", false))
.Returns(new[] { plistPath });
Mocker.GetMock<IDiskProvider>()
@@ -49,7 +49,7 @@ namespace NzbDrone.Mono.Test.EnvironmentInfo.VersionAdapters
.Setup(c => c.FolderExists("/System/Library/CoreServices/")).Returns(true);
Mocker.GetMock<IDiskProvider>()
.Setup(c => c.GetFiles("/System/Library/CoreServices/", SearchOption.TopDirectoryOnly))
.Setup(c => c.GetFiles("/System/Library/CoreServices/", false))
.Returns(new[] { plistPath });
Mocker.GetMock<IDiskProvider>()
@@ -69,7 +69,7 @@ namespace NzbDrone.Mono.Test.EnvironmentInfo.VersionAdapters
Subject.Read().Should().BeNull();
Mocker.GetMock<IDiskProvider>()
.Verify(c => c.GetFiles(It.IsAny<string>(), SearchOption.TopDirectoryOnly), Times.Never());
.Verify(c => c.GetFiles(It.IsAny<string>(), false), Times.Never());
}
}
}