-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added unit tests for boolean extentions
- Loading branch information
Showing
3 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
Source/MoreDotNet.Test/Extentions/Common/BooleanExtentions/WhenFalseTests.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,47 @@ | ||
namespace MoreDotNet.Tests.Extentions.Common.BooleanExtentions | ||
{ | ||
using MoreDotNet.Extentions.Common; | ||
|
||
using Xunit; | ||
|
||
public class WhenFalseTests | ||
{ | ||
[Fact] | ||
public void WhenFalse_ParseFalseValue_ShouldReturnContent() | ||
{ | ||
var input = false; | ||
var inputContent = "Hello Worlds!"; | ||
var expected = "Hello Worlds!"; | ||
var actual = input.WhenFalse(expected); | ||
Assert.Equal(expected, actual); | ||
} | ||
|
||
[Fact] | ||
public void WhenFalse_ParseTrueValue_ShouldReturnDefaultValueOfContent() | ||
{ | ||
var input = true; | ||
var inputContent = "Hello Worlds!"; | ||
var expected = default(string); | ||
var actual = input.WhenFalse(expected); | ||
Assert.Equal(expected, actual); | ||
} | ||
|
||
[Fact] | ||
public void WhenFalse_ParseFalseValue_ShouldExecuteAction() | ||
{ | ||
var input = false; | ||
var expected = "Hello Worlds!"; | ||
var actual = input.WhenFalse(() => "Hello Worlds!"); | ||
Assert.Equal(expected, actual); | ||
} | ||
|
||
[Fact] | ||
public void WhenFalse_ParseTrueValue_ShouldNotExecuteAction() | ||
{ | ||
var input = true; | ||
var expected = default(string); | ||
var actual = input.WhenFalse(() => "Hello Worlds!"); | ||
Assert.Equal(expected, actual); | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
Source/MoreDotNet.Test/Extentions/Common/BooleanExtentions/WhenTrueTests.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,47 @@ | ||
namespace MoreDotNet.Tests.Extentions.Common.BooleanExtentions | ||
{ | ||
using MoreDotNet.Extentions.Common; | ||
|
||
using Xunit; | ||
|
||
public class WhenTrueTests | ||
{ | ||
[Fact] | ||
public void WhenTrue_ParseTrueValue_ShouldReturnContent() | ||
{ | ||
var input = true; | ||
var inputContent = "Hello Worlds!"; | ||
var expected = "Hello Worlds!"; | ||
var actual = input.WhenTrue(expected); | ||
Assert.Equal(expected, actual); | ||
} | ||
|
||
[Fact] | ||
public void WhenTrue_ParseFalseValue_ShouldReturnDefaultValueOfContent() | ||
{ | ||
var input = true; | ||
var inputContent = "Hello Worlds!"; | ||
var expected = default(string); | ||
var actual = input.WhenTrue(expected); | ||
Assert.Equal(expected, actual); | ||
} | ||
|
||
[Fact] | ||
public void WhenTrue_ParseTrueValue_ShouldExecuteAction() | ||
{ | ||
var input = true; | ||
var expected = "Hello Worlds!"; | ||
var actual = input.WhenTrue(() => "Hello Worlds!"); | ||
Assert.Equal(expected, actual); | ||
} | ||
|
||
[Fact] | ||
public void WhenTrue_ParseFalseValue_ShouldNotExecuteAction() | ||
{ | ||
var input = false; | ||
var expected = default(string); | ||
var actual = input.WhenTrue(() => "Hello Worlds!"); | ||
Assert.Equal(expected, actual); | ||
} | ||
} | ||
} |
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