My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
5MinuteIntro  
5-Minute Introduction to FsUnit
Featured
Updated Feb 12, 2010 by R.Verna...@gmail.com

Referencing FsUnit

You can make use of FsUnit in your project in one of two ways (choose either 1 or 2, you don't need to do both):

  1. Reference the FsUnit assembly.
  2. Copy the FsUnit source file into your test project. All of FsUnit is contained within a single file.

You will also need to grab a reference to the test framework that you are using, e.g., NUnit, MbUnit*, etc.

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:

[<TestFixture>]
type MyFixture() =
    [<Test>]
    member this.MyTest() =
        true |> should be True

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

* Not yet supported.


Sign in to add a comment
Powered by Google Project Hosting