Skip to content

Conversation

@vbreuss
Copy link
Member

@vbreuss vbreuss commented Aug 10, 2025

This PR adds comprehensive support for working with UnixFileMode in the Testably.Abstractions testing framework. The implementation provides Unix file permission simulation capabilities for the mock file system, enabling developers to test Unix-specific file permission behaviors in their code.

Key Changes

  • Added IUnixFileModeStrategy interface and implementations for simulating Unix file permissions
  • Enhanced storage layer to enforce Unix file mode access controls
  • Added comprehensive test coverage for Unix file mode behaviors across File, Directory, and DirectoryInfo operations

@vbreuss vbreuss self-assigned this Aug 10, 2025
@vbreuss vbreuss added the enhancement New feature or request label Aug 10, 2025
Copilot AI review requested due to automatic review settings August 10, 2025 09:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive support for working with UnixFileMode in the Testably.Abstractions testing framework. The implementation provides Unix file permission simulation capabilities for the mock file system, enabling developers to test Unix-specific file permission behaviors in their code.

Key Changes

  • Added IUnixFileModeStrategy interface and implementations for simulating Unix file permissions
  • Enhanced storage layer to enforce Unix file mode access controls
  • Added comprehensive test coverage for Unix file mode behaviors across File, Directory, and DirectoryInfo operations

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Tests/Testably.Abstractions.Tests/FileSystem/File/UnixFileModeTests.cs Added tests for file operations with Unix file mode restrictions
Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/UnixFileModeTests.cs New test file for DirectoryInfo Unix file mode behaviors
Tests/Testably.Abstractions.Tests/FileSystem/Directory/UnixFileModeTests.cs New test file for Directory Unix file mode behaviors
Tests/Testably.Abstractions.Testing.Tests/MockFileSystemTests.cs Added tests for Unix file mode strategy configuration and platform restrictions
Tests/Api/Testably.Abstractions.Api.Tests/Expected/*.txt Updated API surface definitions to include new Unix file mode interfaces and classes
Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs Enhanced storage enumeration and access control with Unix file mode support
Source/Testably.Abstractions.Testing/Storage/InMemoryContainer.cs Added Unix file mode property and access validation to storage containers
Source/Testably.Abstractions.Testing/Storage/IStorage.cs Updated interface to support parent access requests for Unix permission checks
Source/Testably.Abstractions.Testing/MockFileSystem.cs Added Unix file mode strategy configuration and platform validation
Source/Testably.Abstractions.Testing/Initializer/DirectoryCleaner.cs Enhanced directory cleanup to handle Unix file permissions
Source/Testably.Abstractions.Testing/Helpers/ExceptionFactory.cs Added Unix file mode specific exception factory method
Source/Testably.Abstractions.Testing/FileSystem/NullUnixFileModeStrategy.cs New null object implementation for Unix file mode strategy
Source/Testably.Abstractions.Testing/FileSystem/IUnixFileModeStrategy.cs New interface defining Unix file mode simulation strategy
Source/Testably.Abstractions.Testing/FileSystem/DirectoryMock.cs Enhanced directory operations to handle Unix file mode exceptions
Source/Testably.Abstractions.Testing/FileSystem/DirectoryInfoMock.cs Enhanced DirectoryInfo operations to handle Unix file mode exceptions

@vbreuss vbreuss enabled auto-merge (squash) August 10, 2025 10:03
@sonarqubecloud
Copy link

@vbreuss vbreuss merged commit 064b5bb into main Aug 10, 2025
14 checks passed
@vbreuss vbreuss deleted the topic/support-working-with-unixfilemode branch August 10, 2025 10:19
@vbreuss vbreuss linked an issue Aug 10, 2025 that may be closed by this pull request
@github-actions
Copy link

This is addressed in release v4.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request state: released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to Simulate Directory.CreateDirectory(path, UnixFileMode)?

2 participants