@@ -628,7 +628,8 @@ public void MockFile_Move_ShouldMoveFileWithinMemoryFileSystem()
628628 const string sourceFileContent = "this is some content" ;
629629 var fileSystem = new MockFileSystem ( new Dictionary < string , MockFileData >
630630 {
631- { sourceFilePath , new MockFileData ( sourceFileContent ) }
631+ { sourceFilePath , new MockFileData ( sourceFileContent ) } ,
632+ { @"c:\somethingelse\dummy.txt" , new MockFileData ( new byte [ ] { 0 } ) }
632633 } ) ;
633634
634635 const string destFilePath = @"c:\somethingelse\demo1.txt" ;
@@ -840,6 +841,24 @@ public void MockFile_Move_ShouldThrowFileNotFoundExceptionWhenSourceDoesNotExist
840841 Assert . That ( exception . FileName , Is . EqualTo ( @"c:\something\demo.txt" ) ) ;
841842 }
842843
844+ [ Test ]
845+ public void MockFile_Move_ShouldThrowDirectoryNotFoundExceptionWhenSourcePathDoesNotExist_Message ( )
846+ {
847+ const string sourceFilePath = @"c:\something\demo.txt" ;
848+ const string destFilePath = @"c:\somethingelse\demo.txt" ;
849+ var fileSystem = new MockFileSystem ( new Dictionary < string , MockFileData >
850+ {
851+ { sourceFilePath , new MockFileData ( new byte [ ] { 0 } ) }
852+ } ) ;
853+
854+ //var exists = fileSystem.Directory.Exists(@"c:\something");
855+ //exists = fileSystem.Directory.Exists(@"c:\something22");
856+
857+ var exception = Assert . Throws < DirectoryNotFoundException > ( ( ) => fileSystem . File . Move ( sourceFilePath , destFilePath ) ) ;
858+ //Message = "Could not find a part of the path."
859+ Assert . That ( exception . Message , Is . EqualTo ( @"Could not find a part of the path." ) ) ;
860+ }
861+
843862 [ Test ]
844863 public void MockFile_OpenWrite_ShouldCreateNewFiles ( ) {
845864 const string filePath = @"c:\something\demo.txt" ;
0 commit comments