-
-
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 #345 from JakeGinnivan/DocsWork
Created documentation samples project which outputs files to be inclu…
- Loading branch information
Showing
32 changed files
with
556 additions
and
153 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 was deleted.
Oops, something went wrong.
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,27 @@ | ||
Configuration | ||
============= | ||
|
||
Shouldly has a few configuration options: | ||
|
||
DefaultFloatingPointTolerance | ||
----------------------------- | ||
|
||
Allows specifying a floating point tolerance for all assertions | ||
|
||
**Default value:** 0.0d | ||
|
||
DefaultTaskTimeout | ||
------------------ | ||
:code:`Should.Throw(Func<Task>)` blocks, the timeout is a safeguard for deadlocks. | ||
|
||
Shouldly runs the lambda without a synchronisation context, but deadlocks are still possible. Use :code:`Should.ThrowAsync` to be safe then await the returned task to prevent possible deadlocks. | ||
|
||
**Default value:** 10 seconds | ||
|
||
CompareAsObjectTypes | ||
-------------------- | ||
Types which also are IEnumerable of themselves. | ||
|
||
An example is :code:`Newtonsoft.Json.Linq.JToken` which looks like this :code:`class JToken : IEnumerable<JToken>`. | ||
|
||
**Default value:** Newtonsoft.Json.Linq.JToken |
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
2 changes: 2 additions & 0 deletions
2
src/DocumentationExamples/CodeExamples/BooleanExample.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 @@ | ||
const bool myValue = false; | ||
myValue.ShouldBe(true, "Some additional context"); |
8 changes: 8 additions & 0 deletions
8
src/DocumentationExamples/CodeExamples/BooleanExample.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,8 @@ | ||
myValue | ||
should be | ||
True | ||
but was | ||
False | ||
|
||
Additional Info: | ||
Some additional context |
2 changes: 2 additions & 0 deletions
2
src/DocumentationExamples/CodeExamples/DateTime.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 @@ | ||
var date = new DateTime(2000, 6, 1); | ||
date.ShouldBe(new DateTime(2000, 6, 1, 1, 0, 1), TimeSpan.FromHours(1)); |
7 changes: 7 additions & 0 deletions
7
src/DocumentationExamples/CodeExamples/DateTime.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,7 @@ | ||
date | ||
should be within | ||
01:00:00 | ||
of | ||
1/06/2000 1:00:01 AM | ||
but was | ||
1/06/2000 12:00:00 AM |
6 changes: 6 additions & 0 deletions
6
src/DocumentationExamples/CodeExamples/Enumerables.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,6 @@ | ||
var apu = new Person { Name = "Apu" }; | ||
var homer = new Person { Name = "Homer" }; | ||
var skinner = new Person { Name = "Skinner" }; | ||
var barney = new Person { Name = "Barney" }; | ||
var theBeSharps = new List<Person> { homer, skinner, barney }; | ||
theBeSharps.ShouldBe(new[] { apu, homer, skinner, barney }); |
7 changes: 7 additions & 0 deletions
7
src/DocumentationExamples/CodeExamples/Enumerables.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,7 @@ | ||
theBeSharps | ||
should be | ||
[Apu, Homer, Skinner, Barney] | ||
but was | ||
[Homer, Skinner, Barney] | ||
difference | ||
[*Homer*, *Skinner*, *Barney*, *] |
3 changes: 3 additions & 0 deletions
3
src/DocumentationExamples/CodeExamples/EnumerablesOfNumerics.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,3 @@ | ||
var firstSet = new[] { 1.23m, 2.34m, 3.45001m }; | ||
var secondSet = new[] { 1.4301m, 2.34m, 3.45m }; | ||
firstSet.ShouldBe(secondSet, 0.1m); |
9 changes: 9 additions & 0 deletions
9
src/DocumentationExamples/CodeExamples/EnumerablesOfNumerics.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,9 @@ | ||
firstSet | ||
should be within | ||
0.1m | ||
of | ||
[1.4301m, 2.34m, 3.45m] | ||
but was | ||
[1.23m, 2.34m, 3.45001m] | ||
difference | ||
[*1.23m*, 2.34m, *3.45001m*] |
2 changes: 2 additions & 0 deletions
2
src/DocumentationExamples/CodeExamples/Numeric.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 @@ | ||
const decimal pi = (decimal)Math.PI; | ||
pi.ShouldBe(3.24m, 0.01m); |
7 changes: 7 additions & 0 deletions
7
src/DocumentationExamples/CodeExamples/Numeric.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,7 @@ | ||
pi | ||
should be within | ||
0.01m | ||
of | ||
3.24m | ||
but was | ||
3.14159265358979m |
2 changes: 2 additions & 0 deletions
2
src/DocumentationExamples/CodeExamples/Objects.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 @@ | ||
var theSimpsonsCat = new Cat { Name = "Santas little helper" }; | ||
theSimpsonsCat.Name.ShouldBe("Snowball 2"); |
13 changes: 13 additions & 0 deletions
13
src/DocumentationExamples/CodeExamples/Objects.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,13 @@ | ||
theSimpsonsCat.Name | ||
should be | ||
"Snowball 2" | ||
but was | ||
"Santas little helper" | ||
difference | ||
Difference | | | | | | | | | | | | | | | | | | | | ||
| \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ | ||
Index | 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ||
Expected Value | S n o w b a l l \s 2 | ||
Actual Value | S a n t a s \s l i t t l e \s h e l p e r | ||
Expected Code | 83 110 111 119 98 97 108 108 32 50 | ||
Actual Code | 83 97 110 116 97 115 32 108 105 116 116 108 101 32 104 101 108 112 101 114 |
2 changes: 2 additions & 0 deletions
2
src/DocumentationExamples/CodeExamples/TimeSpanExample.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 @@ | ||
var timeSpan = TimeSpan.FromHours(1); | ||
timeSpan.ShouldBe(timeSpan.Add(TimeSpan.FromHours(1.1d)), TimeSpan.FromHours(1)); |
7 changes: 7 additions & 0 deletions
7
src/DocumentationExamples/CodeExamples/TimeSpanExample.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,7 @@ | ||
timeSpan | ||
should be within | ||
01:00:00 | ||
of | ||
02:06:00 | ||
but was | ||
01:00:00 |
Oops, something went wrong.