-
-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #350 from JosephWoodward/ShouldBeTrueFalseDocs
Added ShouldBeTrue and ShouldBeFalse docs
- Loading branch information
Showing
8 changed files
with
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
ShouldBeTrue/False | ||
======== | ||
|
||
``ShouldBeTrue`` and ``ShouldBeFalse`` work on boolean values. | ||
|
||
ShouldBeTrue | ||
------------ | ||
.. literalinclude:: /../src/DocumentationExamples/CodeExamples/ShouldBeTrueFalseExamples/ShouldBeTrue.codeSample.approved.txt | ||
:language: c# | ||
|
||
**Exception** | ||
|
||
.. literalinclude:: /../src/DocumentationExamples/CodeExamples/ShouldBeTrueFalseExamples/ShouldBeTrue.exceptionText.approved.txt | ||
|
||
ShouldBeFalse | ||
------------ | ||
|
||
.. literalinclude:: /../src/DocumentationExamples/CodeExamples/ShouldBeTrueFalseExamples/ShouldBeFalse.codeSample.approved.txt | ||
:language: c# | ||
|
||
**Exception** | ||
|
||
.. literalinclude:: /../src/DocumentationExamples/CodeExamples/ShouldBeTrueFalseExamples/ShouldBeFalse.exceptionText.approved.txt |
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
2 changes: 2 additions & 0 deletions
2
...tionExamples/CodeExamples/ShouldBeTrueFalseExamples/ShouldBeFalse.codeSample.approved.txt
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,2 @@ | ||
bool myValue = true; | ||
myValue.ShouldBeFalse(); |
5 changes: 5 additions & 0 deletions
5
...nExamples/CodeExamples/ShouldBeTrueFalseExamples/ShouldBeFalse.exceptionText.approved.txt
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,5 @@ | ||
myValue | ||
should be | ||
False | ||
but was | ||
True |
2 changes: 2 additions & 0 deletions
2
...ationExamples/CodeExamples/ShouldBeTrueFalseExamples/ShouldBeTrue.codeSample.approved.txt
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,2 @@ | ||
bool myValue = false; | ||
myValue.ShouldBeTrue(); |
5 changes: 5 additions & 0 deletions
5
...onExamples/CodeExamples/ShouldBeTrueFalseExamples/ShouldBeTrue.exceptionText.approved.txt
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,5 @@ | ||
myValue | ||
should be | ||
True | ||
but was | ||
False |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Shouldly; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace DocumentationExamples | ||
{ | ||
public class ShouldBeTrueFalseExamples | ||
{ | ||
readonly ITestOutputHelper _testOutputHelper; | ||
|
||
public ShouldBeTrueFalseExamples(ITestOutputHelper testOutputHelper) | ||
{ | ||
_testOutputHelper = testOutputHelper; | ||
} | ||
|
||
[Fact] | ||
public void ShouldBeTrue() | ||
{ | ||
DocExampleWriter.Document(() => | ||
{ | ||
bool myValue = false; | ||
myValue.ShouldBeTrue(); | ||
}, _testOutputHelper); | ||
} | ||
|
||
[Fact] | ||
public void ShouldBeFalse() | ||
{ | ||
DocExampleWriter.Document(() => | ||
{ | ||
bool myValue = true; | ||
myValue.ShouldBeFalse(); | ||
}, _testOutputHelper); | ||
} | ||
|
||
} | ||
} |