-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Align MockDirectory and MockFile behavior with .NET's System.IO …
…classes (#1190) * fix: Align MockDirectory behavior with System.IO.Directory when deleting files The MockDirectory class previously did not replicate the behavior of System.IO.Directory when calling the Delete method on a file path. In System.IO.Directory, an IOException is thrown if the specified path points to a file instead of a directory. This commit updates MockDirectory to ensure it throws an IOException in this scenario, maintaining consistency with the expected behavior of System.IO.Directory. * fix: Align MockFile behavior with System.IO.File when deleting directories The MockFile class previously did not replicate the behavior of System.IO.File when calling the Delete method on a directory path. In System.IO.File, an UnauthorizedAccessException is thrown if the specified path points to a directory instead of a file. This commit updates MockFile to ensure it throws an UnauthorizedAccessException in this scenario, maintaining consistency with the expected behavior of System.IO.File.
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters