-
Book Overview & Buying
-
Table Of Contents
Mastering F#
By :
In this chapter, you learned how to do different kinds of automated testing with F#. We started with one of the most popular techniques in .NET and other programming languages or platforms: unit testing. In F#, we can use some of the most widely used unit testing tools for .NET, such as NUnit, and benefit from its extensive functionality and compatibility with different IDEs. F# has some niceties on its own, such as having more informative names for tests and idiomatic syntax.
We then continued with property-based testing. This is not exclusive of F# or other functional programming languages, but the absence of a shared state makes it usually much easier to test properties of our functions for any given set of parameters. FsCheck makes property testing a breeze by automatically generating hundreds of samples to feed into our functions, and gives a stronger indication of robustness than simple unit tests can. FsCheck also has several tools to helps us locate problems, like shrinkers...
Change the font size
Change margin width
Change background colour