Skip to content

Commit

Permalink
Merge branch 'main' into topic/vb/net8.0-enable
Browse files Browse the repository at this point in the history
  • Loading branch information
vbreuss authored Oct 6, 2023
2 parents 9384205 + 76932e5 commit eb586f0
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ jobs:
name: Code coverage (Windows)
path: Coverage/Windows
- name: Generate coverage report
uses: danielpalme/[email protected].25
uses: danielpalme/[email protected].26
with:
reports: "Coverage/**/coverage.cobertura.xml"
targetdir: "coverage-report"
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Testably_Testably.Abstractions&branch=main&metric=coverage)](https://sonarcloud.io/summary/overall?id=Testably_Testably.Abstractions&branch=main)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FTestably%2FTestably.Abstractions%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/Testably/Testably.Abstractions/main)

This library is an alternative testing helper for the [IFileSystem interfaces from System.IO.Abstractions](https://github.com/TestableIO/System.IO.Abstractions).
These interfaces allow abstracting away all I/O-related functionality from the `System.IO` namespace.
This library is a feature complete testing helper for the [IFileSystem abstractions for I/O-related functionality](https://github.com/TestableIO/System.IO.Abstractions) from the `System.IO` namespace. It uses an in-memory file system that behaves exactly like the real file system and can be used in unit tests for dependency injection.
The testing helper also supports advanced scenarios like
- [Multiple drives with limited size](Examples/DriveManagement/README.md)
- [`FileSystemWatcher`](Examples/FileSystemWatcher/README.md) and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ public void Attributes_ClearAllAttributes_ShouldRemainDirectory(string path)
}

[SkippableTheory]
[AutoData]
[InlineAutoData(FileAttributes.ReadOnly)]
[InlineAutoData(FileAttributes.Normal)]
public void Attributes_WhenFileIsExisting_SetterShouldChangeAttributesOnFileSystem(
string path, FileAttributes attributes)
FileAttributes attributes, string path)
{
FileSystem.Directory.CreateDirectory(path);
IDirectoryInfo sut1 = FileSystem.DirectoryInfo.New(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ public abstract partial class GetAttributesTests<TFileSystem>
where TFileSystem : IFileSystem
{
[SkippableTheory]
[AutoData]
[InlineAutoData(FileAttributes.ReadOnly)]
[InlineAutoData(FileAttributes.Normal)]
public void GetAttributes_ShouldReturnAttributes(
string path, FileAttributes attributes)
FileAttributes attributes, string path)
{
FileSystem.File.WriteAllText(path, null);
FileSystem.File.SetAttributes(path, attributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ public abstract partial class SetAttributesTests<TFileSystem>
where TFileSystem : IFileSystem
{
[SkippableTheory]
[AutoData]
public void SetAttributes_ShouldNotAdjustTimes(string path, FileAttributes attributes)
[InlineAutoData(FileAttributes.ReadOnly)]
[InlineAutoData(FileAttributes.Normal)]
public void SetAttributes_ShouldNotAdjustTimes(FileAttributes attributes, string path)
{
Test.SkipIfLongRunningTestsShouldBeSkipped(FileSystem);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ public void CopyTo_ReadOnly_ShouldCopyFile(
}

[SkippableTheory]
[AutoData]
[InlineAutoData(FileAttributes.ReadOnly)]
[InlineAutoData(FileAttributes.System)]
public void CopyTo_ShouldAddArchiveAttribute_OnWindows(
FileAttributes fileAttributes,
string sourceName,
string destinationName,
string contents,
FileAttributes fileAttributes)
string contents)
{
FileSystem.File.WriteAllText(sourceName, contents);
FileSystem.File.SetAttributes(sourceName, fileAttributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,13 @@ public void MoveTo_ReadOnly_ShouldMoveFile(
}

[SkippableTheory]
[AutoData]
[InlineAutoData(FileAttributes.ReadOnly)]
[InlineAutoData(FileAttributes.System)]
public void MoveTo_ShouldAddArchiveAttribute_OnWindows(
FileAttributes fileAttributes,
string sourceName,
string destinationName,
string contents,
FileAttributes fileAttributes)
string contents)
{
FileSystem.File.WriteAllText(sourceName, contents);
FileSystem.File.SetAttributes(sourceName, fileAttributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,16 @@ public void
}

[SkippableTheory]
[AutoData]
[InlineAutoData(FileAttributes.Hidden, FileAttributes.Hidden)]
[InlineAutoData(FileAttributes.System, FileAttributes.System)]
public void Replace_ShouldAddArchiveAttribute_OnWindows(
FileAttributes sourceFileAttributes,
FileAttributes destinationFileAttributes,
string sourceName,
string destinationName,
string backupName,
string sourceContents,
string destinationContents,
FileAttributes sourceFileAttributes,
FileAttributes destinationFileAttributes)
string destinationContents)
{
FileSystem.File.WriteAllText(sourceName, sourceContents);
FileSystem.File.SetAttributes(sourceName, sourceFileAttributes);
Expand Down

0 comments on commit eb586f0

Please sign in to comment.