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:
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 silly, but we'll be able to see if NUnit detects changes and if NUnit will detect the test cases inside the .exe
file. The steps for writing a simple test case are as follows:
Open up NUnit and navigate to File | Open Project....
Select the
.exe
file corresponding to the .exe? file in TradingSystem.Tests, located in..\visual studio...