5-Minute Introduction to FsUnit

Referencing FsUnit

You can make use of FsUnit in your test project by simply dropping the FsUnit source file into your test project. You will want to place FsUnit at the top of the file list so that it can be used by all of the other files in the project.

Using FsUnit

Once you have a reference to FsUnit, you can create a test fixture and a test. All of the supported test frameworks work in the same manner: declare a new type and mark it as a test fixture then add a member to the type and mark it as a test. Here is an example of a simple test fixture and test in NUnit:

type MyFixture() =
    member this.MyTest() =
        true |> should be True

Compile your project and run the results through your standard testing tools.

* not yet supported

Last edited Mar 27, 2010 at 3:18 AM by Ray_V, version 3


No comments yet.