-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: null-handling in Wrap-Method in factories for
IDriveInfo
or `I…
…FileSystemWatcher` (#977) Building on #976 also fix null-handling for DriveInfo and FileSystemWatcher factories: When providing null as parameter to the implementations of IDriveInfoFactory or IFileSystemWatcherFactory return null instead of throwing an exception. This extends the issue reported in #975 to other factories used in System.IO.Abstractions.
- Loading branch information
Showing
8 changed files
with
82 additions
and
2 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
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
18 changes: 18 additions & 0 deletions
18
tests/TestableIO.System.IO.Abstractions.Wrappers.Tests/DriveInfoFactoryTests.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using NUnit.Framework; | ||
|
||
namespace System.IO.Abstractions.Tests | ||
{ | ||
[TestFixture] | ||
public class DriveInfoFactoryTests | ||
{ | ||
[Test] | ||
public void Wrap_WithNull_ShouldReturnNull() | ||
{ | ||
var fileSystem = new FileSystem(); | ||
|
||
var result = fileSystem.DriveInfo.Wrap(null); | ||
|
||
Assert.IsNull(result); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/TestableIO.System.IO.Abstractions.Wrappers.Tests/FileSystemWatcherFactoryTests.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using NUnit.Framework; | ||
|
||
namespace System.IO.Abstractions.Tests | ||
{ | ||
[TestFixture] | ||
public class FileSystemWatcherFactoryTests | ||
{ | ||
[Test] | ||
public void Wrap_WithNull_ShouldReturnNull() | ||
{ | ||
var fileSystem = new FileSystem(); | ||
|
||
var result = fileSystem.FileSystemWatcher.Wrap(null); | ||
|
||
Assert.IsNull(result); | ||
} | ||
} | ||
} |