Skip to content

Commit

Permalink
Also adjust other tests with FileAttributes as parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
vbreuss committed Oct 6, 2023
1 parent 7f36eb7 commit c2e5415
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
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,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.ReadOnly, FileAttributes.System)]
[InlineAutoData(FileAttributes.System, FileAttributes.ReadOnly)]
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 c2e5415

Please sign in to comment.