Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In the first chapter, I briefly mentioned the importance of creating solutions that are easy to test. A few of the sections in that chapter provide various techniques that you can apply in F# to make your solutions more testable. However, I didn’t go into any detail regarding approaches to create unit tests in F# and/or specific features of F# that can improve this process.
In this section, I’ll walk you through the tools and techniques you can use to unit-test your F# masterpieces. I’ll also showcase a few frameworks that can make this testing easier and/or more enjoyable.
For many of the examples in the next few sections, I’ll be using an ASP.NET Web API controller and a repository that look pretty similar to some of the ASP.NET MVC examples you saw in Chapter 1. The controller looks like the following: