Skip to content

Commit

Permalink
Add sub-headings
Browse files Browse the repository at this point in the history
  • Loading branch information
Christer van der Meeren committed Sep 12, 2023
1 parent ced6810 commit f9607ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* [Installation and requirements](#installation-and-requirements)
* [Avoiding `|> ignore` after assertion chains](#avoiding--ignore-after-assertion-chains)
* [Writing your own assertions](#writing-your-own-assertions)
* [A basic example](#a-basic-example)
* [Derived state](#derived-state)
* [A complex assertion](#a-complex-assertion)
* [Customizing the format](#customizing-the-format)
* [Configuring options](#configuring-options)
* [Security considerations](#security-considerations)
Expand Down Expand Up @@ -75,6 +78,8 @@ in [this folder](https://github.com/cmeeren/Faqt/tree/main/src/Faqt)).

All the details are further below, but first, we'll get a long way just by looking at some examples.

### A basic example

Here is Faqt’s simplest assertion, `Be`:

```f#
Expand Down Expand Up @@ -109,6 +114,8 @@ But was: <subject value>
As you can see, Faqt automatically adds `Subject`, `Because` (if supplied by the user), and `Should` (the name of the
method where you call `t.Assert()`). After that, any additional key-value pairs you specify are displayed in order.

### Derived state

Now let's look at an assertion that's just as simple, but uses derived state, where you return
`AndDerived` instead of `And`:

Expand All @@ -135,6 +142,8 @@ type Assertions =
This allows users to continue asserting on the derived state (the inner value, in this case), for example like
this: `nullableInt.Should().HaveValue().That.Should(()).Be(2)`.

### A complex assertion

Finally, let's look at a more complex assertion - a higher-order assertion that calls user assertions and which also
asserts for every item in a sequence:

Expand Down

0 comments on commit f9607ff

Please sign in to comment.