Skip to content

Commit

Permalink
Merge branch 'jnm2-null_string_should_convert_to_null_path_object' in…
Browse files Browse the repository at this point in the history
…to develop

* jnm2-null_string_should_convert_to_null_path_object:
  Null string should convert to null path object
  • Loading branch information
devlead committed Feb 20, 2019
2 parents 020d6d3 + 3201796 commit 9f3a653
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Cake.Core.Tests/Unit/IO/DirectoryPathTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ namespace Cake.Core.Tests.Unit.IO
{
public sealed class DirectoryPathTests
{
public sealed class TheConversionFromStringOperator
{
[Fact]
public void Null_String_Converts_To_Null_DirectoryPath()
{
// Given
const string nullString = null;

// When
var path = (DirectoryPath)nullString;

// Then
Assert.Null(path);
}
}

public sealed class TheGetDirectoryNameMethod
{
[WindowsTheory]
Expand Down
16 changes: 16 additions & 0 deletions src/Cake.Core.Tests/Unit/IO/FilePathTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ namespace Cake.Core.Tests.Unit.IO
{
public sealed class FilePathTests
{
public sealed class TheConversionFromStringOperator
{
[Fact]
public void Null_String_Converts_To_Null_FilePath()
{
// Given
const string nullString = null;

// When
var path = (FilePath)nullString;

// Then
Assert.Null(path);
}
}

public sealed class TheHasExtensionProperty
{
[Theory]
Expand Down

0 comments on commit 9f3a653

Please sign in to comment.