Commit 04abe02
authored
fix: Propagate null values in Wrap* methods (#982)
When wrapping `FileSystemInfo`, `DirectoryInfo`, and `FileInfo`, null inputs will be correctly propagated.
Prior to this change, the wrappers for all three of these types would throw exceptions:
- `NullReferenceException` for `WrapFileSystemInfo`
- `ArgumentNullException` for `WrapDirectoryInfo`/`WrapFileInfo` (thrown by `DirectoryInfoWrapper`/`FileInfoWrapper`)
Basic unit tests were also added for these null cases.
Fixes #9811 parent 4a54927 commit 04abe02
File tree
2 files changed
+30
-2
lines changed- src/TestableIO.System.IO.Abstractions.Wrappers
- tests/TestableIO.System.IO.Abstractions.Wrappers.Tests
2 files changed
+30
-2
lines changedLines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
50 | | - | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | | - | |
| 58 | + | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
53 | 74 | | |
54 | 75 | | |
0 commit comments