Testing the stack

This is your first introduction to unit testing in F# and requires some familiarity with unit testing frameworks (NUnit, MSTest), as well as NuGet, the .NET Package Manager. You have been working with FSI (FSharp Interactive) within the Visual Studio lately. In this section, we are going to exploit more features of Visual Studio than of REPL.

In order to test the stack methods, Push and Pop, you need to create a test project. Let's first exploit the cross-language functionality provided by MSIL (Microsoft Intermediate Language or IL) and write our first unit tests in C#. Being a member of the .NET family of languages, F#, like C#, and VB.NET, eventually gets translated to IL before it is executed. That is why it is easy to write ...

Get Learning F# Functional Data Structures and Algorithms now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.