@@ -503,8 +503,7 @@ public override void Move(string sourceDirName, string destDirName)
503503 var fullSourcePath = mockFileDataAccessor . Path . GetFullPath ( sourceDirName ) . TrimSlashes ( ) ;
504504 var fullDestPath = mockFileDataAccessor . Path . GetFullPath ( destDirName ) . TrimSlashes ( ) ;
505505
506- if ( XFS . IsUnixPlatform ( ) ? mockFileDataAccessor . StringOperations . Equals ( fullSourcePath , fullDestPath )
507- : string . Equals ( fullSourcePath , fullDestPath , StringComparison . Ordinal ) )
506+ if ( string . Equals ( fullSourcePath , fullDestPath , StringComparison . Ordinal ) )
508507 {
509508 throw new IOException ( "Source and destination path must be different." ) ;
510509 }
@@ -535,17 +534,12 @@ public override void Move(string sourceDirName, string destDirName)
535534 {
536535 throw CommonExceptions . CouldNotFindPartOfPath ( destDirName ) ;
537536 }
538- if ( XFS . IsUnixPlatform ( ) )
539- {
540- if ( mockFileDataAccessor . Directory . Exists ( fullDestPath ) || mockFileDataAccessor . File . Exists ( fullDestPath ) )
541- {
542- throw CommonExceptions . CannotCreateBecauseSameNameAlreadyExists ( fullDestPath ) ;
543- }
544- }
545- else if ( ! string . Equals ( fullSourcePath , fullDestPath , StringComparison . OrdinalIgnoreCase ) )
537+
538+ if ( mockFileDataAccessor . Directory . Exists ( fullDestPath ) || mockFileDataAccessor . File . Exists ( fullDestPath ) )
546539 {
547540 // In Windows, file/dir names are case sensetive, C:\\temp\\src and C:\\temp\\SRC and treated different
548- if ( mockFileDataAccessor . Directory . Exists ( fullDestPath ) || mockFileDataAccessor . File . Exists ( fullDestPath ) )
541+ if ( XFS . IsUnixPlatform ( ) ||
542+ ! string . Equals ( fullSourcePath , fullDestPath , StringComparison . OrdinalIgnoreCase ) )
549543 {
550544 throw CommonExceptions . CannotCreateBecauseSameNameAlreadyExists ( fullDestPath ) ;
551545 }
0 commit comments