@@ -1164,7 +1164,7 @@ public void Move_DirectoryExistsWithDifferentCase_DirectorySuccessfullyMoved()
11641164 }
11651165
11661166 [ TestCaseSource ( "GetPathsForMoving" ) ]
1167- public void MockDirectory_Move_ShouldMove ( string sourceDirName , string destDirName , string filePathOne , string filePathTwo )
1167+ public void MockDirectory_Move_ShouldMoveDirectories ( string sourceDirName , string destDirName , string filePathOne , string filePathTwo )
11681168 {
11691169 // Arrange
11701170 var fileSystem = new MockFileSystem ( new Dictionary < string , MockFileData >
@@ -1182,6 +1182,26 @@ public void MockDirectory_Move_ShouldMove(string sourceDirName, string destDirNa
11821182 Assert . IsTrue ( fileSystem . File . Exists ( XFS . Path ( destDirName + filePathTwo ) ) ) ;
11831183 }
11841184
1185+ [ Test ]
1186+ public void MockDirectory_Move_ShouldMoveFiles ( )
1187+ {
1188+ string sourceFilePath = XFS . Path ( @"c:\demo.txt" ) ;
1189+ string sourceFileContent = "this is some content" ;
1190+
1191+ var fileSystem = new MockFileSystem ( new Dictionary < string , MockFileData >
1192+ {
1193+ { sourceFilePath , new MockFileData ( sourceFileContent ) }
1194+ } ) ;
1195+
1196+ string destFilePath = XFS . Path ( @"c:\demo1.txt" ) ;
1197+
1198+ fileSystem . Directory . Move ( sourceFilePath , destFilePath ) ;
1199+
1200+ Assert . That ( fileSystem . FileExists ( destFilePath ) , Is . True ) ;
1201+ Assert . That ( fileSystem . FileExists ( sourceFilePath ) , Is . False ) ;
1202+ Assert . That ( fileSystem . GetFile ( destFilePath ) . TextContents , Is . EqualTo ( sourceFileContent ) ) ;
1203+ }
1204+
11851205 [ Test ]
11861206 public void MockDirectory_Move_ShouldMoveDirectoryAtrributes ( )
11871207 {
0 commit comments