FsCheck setup in F#
08 February 2015
In the previous post I used Cabal to bootstrap QuickCheck with Hspec. In Haskell, Cabal is a build system which also doubles as a package manager.
This post attempts to do the same in F#; bootstrap FsCheck with xUnit.net, but instead of MSBuild and XML, I’m going to use Paket, Fake, and F#.
Install Paket, if not already installed:
Reference Paket and specify the required packages:
Reference Fake and specify the build parameters:
Use Fake’s DSL to define the build tasks:
Compose the build tasks into a build pipeline:
Add a simple (icebreaker) test, because there’s always a bit of work involved in
getting everything up and running:
Run a build:
Run the following command in a terminal:
See the tests running, and passing, via xUnit.net’s built-in test runner:
See the test failing, as a form of Double Entry Bookkeeping:
Re-run the command in a terminal:
For convenience, all the above are also available on GitHub.