Skip to content

Commit

Permalink
Merge pull request #201 from CaptnCodr/feature/Expecto-Doc
Browse files Browse the repository at this point in the history
Add Expecto link to docs.
  • Loading branch information
CaptnCodr authored Feb 14, 2022
2 parents 36c9d33 + f7355ac commit 103fc3d
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
63 changes: 63 additions & 0 deletions docs/Expecto.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
(*** hide ***)
#r "nuget: Expecto"

(**
Expecto
========================
<div class="row">
<div class="span1"></div>
<div class="span6">
<div class="well well-small" id="nuget">
The Expecto library can be <a href="https://nuget.org/packages/Expecto">installed from NuGet</a>:
<pre>PM> Install-Package Expecto</pre>
</div>
</div>
<div class="span1"></div>
</div>
*)

(**
**Expecto.Flip** has a similar syntax to `FsUnit`.
`Expecto` is **not** part of FsUnit.
Syntax
-------
With `Expecto.Flip` you can write your unit tests like this:
*)

open Expecto.Flip.Expect

(**
One object equals or does not equal another:
*)

1 |> equal "1 is equal to 1." 1
1 |> notEqual "1 is not equal to 2." 2

(**
One comparable value greater or smaller than another:
*)

(11, 10) |> isGreaterThan "11 is greater than 10."
(10, 11) |> isLessThan "10 is less than 11."

(**
& more operators:
*)

true |> isTrue "Value is true."
false |> isFalse "Value is false."

"" |> isEmpty
"Foobar" |> isNotEmpty "Value is not empty."
None |> isNone "Value is None."

{1 .. 10} |> contains "Seq 1 to 10 contains 4." 4

(**
All operators are listed here: <a href="https://github.com/haf/expecto/blob/main/Expecto/Flip.Expect.fs">Expecto.Flip.Expect</a>
*)
5 changes: 4 additions & 1 deletion docs/_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://github.com/haf/expecto">Expecto</a></li>
<li><a href="https://fscheck.github.io/FsCheck/">FsCheck</a></li>
<li><a href="https://github.com/fsprojects/Foq">Foq</a></li>
<li><a href="https://fsharp.org">fsharp.org</a></li>
Expand Down Expand Up @@ -58,7 +59,7 @@ <h3 class="muted"><a href="./index.html">{{fsdocs-collection-name}}</a></h3>
</div>
</div> -->
<!-- END SEARCH BOX: this adds support for the search box -->

<ul class="nav nav-list" id="menu">
<li class="nav-header">{{fsdocs-collection-name}}</li>
<li><a href="./index.html">Home page</a></li>
Expand All @@ -77,6 +78,8 @@ <h3 class="muted"><a href="./index.html">{{fsdocs-collection-name}}</a></h3>
<li class="nav-header">Documentation</li>
<li><a href="./operators.html">Operators</a></li>
<!-- <li><a href="{{root}}/reference/index.html">API Reference</a></li> -->
<li class="nav-header">Miscellaneous</li>
<li><a href="./Expecto.html">Expecto</a></li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 103fc3d

Please sign in to comment.