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)); }); }