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