O'Reilly logo

F# for Quantitative Finance by Johan Astborg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing test cases

In this section we'll look at some of the test cases that can be written for the trading system. We'll use NUnit together with the graphical user interface provided by NUnit to accomplish this. The following screenshot displays the main GUI from NUnit:

Writing test cases

Figure 4: The NUnit user interface

Before we start to write real tests for our system, we'll write a simple test to verify that our setup is correct. NUnit will automatically rerun the executable every time it's built. We start by writing a simple test inside the TestOrderValidation file, before we write the real ones:

[<Test>]
let OneIsEqualToOne() =
    1 |> should equal 1

This is quite ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required