Skip to content

Commit cbdd8a6

Browse files
committed
fix: removed the check from mcokDirectory
1 parent 5d32890 commit cbdd8a6

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/TestableIO.System.IO.Abstractions.TestingHelpers/MockDirectory.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)