diff options
Diffstat (limited to 'src/System.IO.FileSystem/tests/Directory/Move.cs')
-rw-r--r-- | src/System.IO.FileSystem/tests/Directory/Move.cs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/System.IO.FileSystem/tests/Directory/Move.cs b/src/System.IO.FileSystem/tests/Directory/Move.cs index 8c21954c03..1da296c1c3 100644 --- a/src/System.IO.FileSystem/tests/Directory/Move.cs +++ b/src/System.IO.FileSystem/tests/Directory/Move.cs @@ -242,8 +242,9 @@ namespace System.IO.Tests } [Fact] - [PlatformSpecific(TestPlatforms.Windows)] // Wild characters in path, wild chars are normal chars on Unix - public void WindowsWildCharacterPath() + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)] + public void WindowsWildCharacterPath_Desktop() { Assert.Throws<ArgumentException>(() => Move("*", GetTestFilePath())); Assert.Throws<ArgumentException>(() => Move(TestDirectory, "*")); @@ -252,6 +253,17 @@ namespace System.IO.Tests } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] + public void WindowsWildCharacterPath_Core() + { + Assert.ThrowsAny<IOException>(() => Move(Path.Combine(TestDirectory, "*"), GetTestFilePath())); + Assert.ThrowsAny<IOException>(() => Move(TestDirectory, Path.Combine(TestDirectory, "*"))); + Assert.ThrowsAny<IOException>(() => Move(TestDirectory, Path.Combine(TestDirectory, "Test*t"))); + Assert.ThrowsAny<IOException>(() => Move(TestDirectory, Path.Combine(TestDirectory, "*Test"))); + } + + [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] // Wild characters in path are allowed public void UnixWildCharacterPath() { @@ -278,17 +290,13 @@ namespace System.IO.Tests } [Fact] - [PlatformSpecific(TestPlatforms.Windows)] // Whitespace path causes ArgumentException - public void WindowsWhitespacePath() + [PlatformSpecific(TestPlatforms.Windows)] + public void WindowsEmptyPath() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); Assert.Throws<ArgumentException>(() => Move(testDir.FullName, " ")); - Assert.Throws<ArgumentException>(() => Move(testDir.FullName, "\n")); Assert.Throws<ArgumentException>(() => Move(testDir.FullName, "")); - Assert.Throws<ArgumentException>(() => Move(testDir.FullName, ">")); - Assert.Throws<ArgumentException>(() => Move(testDir.FullName, "<")); Assert.Throws<ArgumentException>(() => Move(testDir.FullName, "\0")); - Assert.Throws<ArgumentException>(() => Move(testDir.FullName, "\t")); } [Fact] |