Sometimes, unit tests are really small – so small that they fit on a single line:
module inside module
Nested modules allow putting unit tests into a hierarchy.
double backtick identifiers
Get nice to read test identifiers by using double backticks.
test <@ ... @> function is from Unquote – my favourite assertion library. Just write code, no special assertion (fluent) syntax.
We use the
%% operator to generate test values from strings. Here, it generates an employee ID. We do this because we use a lot of handwritten IDs in our tests, and this reduces visual noise dramatically in bigger tests.
Ask if you want to know how this works 🙂
FsToolkit.ErrorHandling is not used in this code. But since we use it a lot, I added it to the F# file template.