Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ await That(FileSystem.DirectoryInfo.New(parent).Attributes)
public async Task CreateDirectory_ShouldSupportExtendedLengthPaths()
{
Skip.If(!Test.RunsOnWindows);
Skip.If(Test.IsNetFramework, "Extended-length paths are not supported on .NET Framework.");

FileSystem.DirectoryInfo.New(@"\\?\c:\bar").Create();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ public async Task EnumerateDirectories_ShouldIncludeEmptyDirectoriesWithTrailing
public async Task EnumerateDirectories_ShouldSupportExtendedLengthPaths1()
{
Skip.If(!Test.RunsOnWindows);
Skip.If(Test.IsNetFramework, "Extended-length paths are not supported on .NET Framework.");

FileSystem.Directory.CreateDirectory(@"\\?\c:\bar");
FileSystem.File.WriteAllText(@"\\?\c:\bar\foo1.txt", "foo1");
Expand All @@ -231,6 +232,7 @@ await That(result)
public async Task EnumerateDirectories_ShouldSupportExtendedLengthPaths2()
{
Skip.If(!Test.RunsOnWindows);
Skip.If(Test.IsNetFramework, "Extended-length paths are not supported on .NET Framework.");

FileSystem.Directory.CreateDirectory(@"\\?\c:\bar");
FileSystem.File.WriteAllText(@"\\?\c:\bar\foo1.txt", "foo1");
Expand Down
16 changes: 5 additions & 11 deletions Tests/Testably.Abstractions.Tests/FileSystem/File/CopyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,17 @@ public async Task
string source, string destination)
{
Skip.IfNot(Test.RunsOnWindows);
Skip.If(Test.IsNetFramework, "Invalid paths throw inconsistently on .NET Framework.");

void Act()
{
FileSystem.File.Copy(source, destination);
}

if (Test.IsNetFramework)
{
await That(Act).Throws<NotSupportedException>().WithHResult(-2146233067);
}
else
{
await That(Act).Throws<IOException>()
.WithMessageContaining(
"The filename, directory name, or volume label syntax is incorrect").And
.WithHResult(-2147024773);
}
await That(Act).Throws<IOException>()
.WithMessageContaining(
"The filename, directory name, or volume label syntax is incorrect").And
.WithHResult(-2147024773);
}

[Test]
Expand Down
Loading