From 4862187a8cbc822ce7e762263a805a608f17d744 Mon Sep 17 00:00:00 2001 From: Jeremy Kuhne Date: Tue, 18 Jul 2017 12:59:43 -0700 Subject: [PATCH] Fix test assertions for long paths We don't preemptively check path length any more. The OS errors we get back can either be PathTooLong or NotFound depending on the environment and requested path. --- src/System.IO.FileSystem/tests/Directory/Move.cs | 4 ++-- src/System.IO.FileSystem/tests/File/Move.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/System.IO.FileSystem/tests/Directory/Move.cs b/src/System.IO.FileSystem/tests/Directory/Move.cs index 2bdf5583159c..80482e43e267 100644 --- a/src/System.IO.FileSystem/tests/Directory/Move.cs +++ b/src/System.IO.FileSystem/tests/Directory/Move.cs @@ -207,8 +207,8 @@ public void Path_Longer_Than_MaxLongPath_Throws_Exception() Directory.CreateDirectory(testDir); Assert.All((IOInputs.GetPathsLongerThanMaxLongPath(GetTestFilePath())), (path) => { - Assert.Throws(() => Move(testDir, path)); - Assert.Throws(() => Move(path, testDir)); + AssertExtensions.ThrowsAny(() => Move(testDir, path)); + AssertExtensions.ThrowsAny(() => Move(path, testDir)); }); } diff --git a/src/System.IO.FileSystem/tests/File/Move.cs b/src/System.IO.FileSystem/tests/File/Move.cs index 2f467c8cd12f..00fb4ace14be 100644 --- a/src/System.IO.FileSystem/tests/File/Move.cs +++ b/src/System.IO.FileSystem/tests/File/Move.cs @@ -215,9 +215,9 @@ public void LongPath() Assert.All(IOInputs.GetPathsLongerThanMaxLongPath(GetTestFilePath()), (path) => { - Assert.Throws(() => Move(testFileSource, path)); + AssertExtensions.ThrowsAny(() => Move(testFileSource, path)); File.Delete(testFileSource); - Assert.Throws(() => Move(path, testFileSource)); + AssertExtensions.ThrowsAny(() => Move(path, testFileSource)); }); }