File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
src/TestableIO.System.IO.Abstractions.TestingHelpers Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -502,12 +502,7 @@ public override void Move(string sourceDirName, string destDirName)
502502 {
503503 var fullSourcePath = mockFileDataAccessor . Path . GetFullPath ( sourceDirName ) . TrimSlashes ( ) ;
504504 var fullDestPath = mockFileDataAccessor . Path . GetFullPath ( destDirName ) . TrimSlashes ( ) ;
505-
506- if ( mockFileDataAccessor . StringOperations . Equals ( fullSourcePath , fullDestPath ) )
507- {
508- throw new IOException ( "Source and destination path must be different." ) ;
509- }
510-
505+
511506 //if we're moving a file, not a directory, call the appropriate file moving function.
512507 var fileData = mockFileDataAccessor . GetFile ( fullSourcePath ) ;
513508 if ( fileData ? . Attributes . HasFlag ( FileAttributes . Directory ) == false )
@@ -534,12 +529,7 @@ public override void Move(string sourceDirName, string destDirName)
534529 {
535530 throw CommonExceptions . CouldNotFindPartOfPath ( destDirName ) ;
536531 }
537-
538- if ( mockFileDataAccessor . Directory . Exists ( fullDestPath ) || mockFileDataAccessor . File . Exists ( fullDestPath ) )
539- {
540- throw CommonExceptions . CannotCreateBecauseSameNameAlreadyExists ( fullDestPath ) ;
541- }
542-
532+
543533 mockFileDataAccessor . MoveDirectory ( fullSourcePath , fullDestPath ) ;
544534 }
545535
You can’t perform that action at this time.
0 commit comments