mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 18:57:24 +00:00
Fixes hidden detection for directory paths with trailing separators.
This commit is contained in:
1 parent
b46dce745b
commit
7f4c8cc8b9
2 files changed
+19
-1
No files matched your search
+16
@@ -226,6 +226,22 @@ public class DirectoryProviderServiceTests
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsHidden_WhenDirectoryPathEndsWithSeparator_ShouldCheckAttributesWithoutSeparator()
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.Create(_pathHidden2);
|
||||
_mockFileSystem.Path.DirectorySeparatorChar.Returns(_dirSeparator);
|
||||
_mockFileSystemPermissionsService.CanAccessPath(path, FileAccessMode.ReadProperties, false).Returns(true);
|
||||
_mockFileSystem.File.GetAttributes(_pathHidden1).Returns(FileAttributes.Directory | FileAttributes.Hidden);
|
||||
|
||||
// Act
|
||||
bool result = _sut.IsHidden(path);
|
||||
|
||||
// Assert
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsHidden_WhenDirectoryDoesNotHaveHiddenAttribute_ShouldReturnFalse()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user