Skip to content

Tags: TestableIO/System.IO.Abstractions

Tags

v22.0.15

Toggle v22.0.15's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: MockFileSystem's File.WriteAllText, File.ReadAllText, Directory.…

…GetFiles, Directory.Create fail with \\?\C:\foo style paths (#1305)

* Test that MockDirectory.CreateDirectory supports windows extended-length paths

Windows paths can have a `\\?\` prefix, the '?' character is not always invalid.
Ref: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

Refers to #1304

* Make MockDirectory_CreateDirectory_ShouldSupportExtendedLengthPaths pass

Fixes #1304

* Also test that MockDirectory.CreateDirectory with an extended path returns a DirectoryInfo with an extended path

* Make MockFileSystem's File.WriteAllText, File.ReadAllText and Directory.GetFiles support extended length paths too

* Refactor a little

---------

Co-authored-by: Valentin Breuß <vbreuss@gmail.com>

v22.0.14

Toggle v22.0.14's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: `Directory.Move` fails on Windows if destination has different c…

…ase from source (#1256)

On Windows, `MockFileSystem.Directory.Move` no longer throws a `System.IO.IOException` when source and destination path only differ in casing.

v22.0.13

Toggle v22.0.13's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: handle case-sensitive file overwrite on Windows and add tests (#…

…1259)

This PR fixes an issue (#1140) where copying a file with the same name but different casing on Windows resulted in an "already in use" error. It aligns the behavior with the native file system.  

## Changes  
- Fixed file overwrite logic to properly handle case-insensitive paths on Windows.  
- Added Windows-specific checks to mimic `System.IO.File.Copy` `System.IO.File.Move` and `System.IO.File.Replace` behavior.  
- Implemented test cases to verify expected behavior for case-sensitive and case-insensitive file systems. 
- Ensured that the fix does not affect Linux behavior.  

## Testing  
- Verified that the fix works correctly on Windows by checking file existence before and after copying,moving and replacing file with different cases 
- Ran test cases on both Windows and Linux to ensure no unintended side effects.

v22.0.12

Toggle v22.0.12's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: Make MockDirectory.Exists behavior with forward slash on Windows…

… consistent with actual file system (#1245)

# Changes
- Removed Unix OS check in `MockDirectory.Exists`
- Added additional tests for `MockDirectory`, `MockDirectoryInfo`, `FileSystem.Directory`

v22.0.11

Toggle v22.0.11's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: move a read-only file (#1239)

Fixes the bug reported in #1207 (which was introduced in #870) that it is not possible to move a read-only file:
The `AddFile` and `RemoveFile` now have an optional parameter `verifyAccess` which if set to `false` will omit the access check, thus not throwing the `UnauthorizedAccessException`.

v22.0.10

Toggle v22.0.10's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: avoid duplicate commit ID in file version (#1225)

Currently the Commit SHA is added twice in the file version.

Set `IncludeSourceRevisionInInformationalVersion` to false, to avoid the automatic suffix and only use the explicit one in the pipeline.

v22.0.10-beta.1

Toggle v22.0.10-beta.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
refactor: support pre-release versions (#1224)

Support creating pre-release nuget packages.

v22.0.9

Toggle v22.0.9's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat!: increase minimal framework version from 4.6.2 to 4.7.2 (#1210)

Preparation for migrating to xunit, as the runner there also requires minimum framework version 4.7.2

v21.3.1

Toggle v21.3.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat: update version to 21.3 due to .NET9 support (#1195)

v21.2.12

Toggle v21.2.12's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat: add new `File` methods from .NET 9 (#1193)

- Task AppendAllBytesAsync(string, byte[], CancellationToken)
- Task AppendAllBytesAsync(string, ReadOnlyMemory<byte>, CancellationToken)
- Task AppendAllTextAsync(string, ReadOnlyMemory<char>, Encoding, CancellationToken)
- Task AppendAllTextAsync(string, ReadOnlyMemory<char>, CancellationToken)
- Task WriteAllBytesAsync(string, ReadOnlyMemory<byte>, CancellationToken)
- Task WriteAllTextAsync(string, ReadOnlyMemory<char>, Encoding, CancellationToken)
- Task WriteAllTextAsync(string, ReadOnlyMemory<char>, CancellationToken)
- void AppendAllBytes(string, byte[])
- void AppendAllBytes(string, ReadOnlySpan<byte>)
- void AppendAllText(string, ReadOnlySpan<char>)
- void AppendAllText(string, ReadOnlySpan<char>, Encoding)
- void WriteAllBytes(string, ReadOnlySpan<byte>)
- void WriteAllText(string, ReadOnlySpan<char>)
- void WriteAllText(string, ReadOnlySpan<char>, Encoding)