Project Description
This project is designed to Language Oriented Programming constructs around unit testing and behavior testing in F#.

The goal of this project is to create a Domain Specific Language for testing F# code in a way that makes sense for functional programming. F# has unique language constructs which can make very flexible testing languages. This project intends to explore those options to create a more intention driven experience.

Based off ideas from FsUnit this testing DSL is currently targeting the xUnit.net framework with the intention of targeting other frameworks.

Some of the syntax possibilities are the following:

Testing equality:
"foo" |> should equal "foo"
"foo" |> should not_equal "bar"
null |> should be Null
"foo" |> should be NonNull
"foobar" |> should contain "foo"
"foobar" |> should not_contain "hello"

Testing True/False:
true |> should be True
false |> should be False

Testing collections:
[1..10] |> should be NonEmpty
[] |> should be Empty
[1..10] |> should have 3
[1..10] |> should not_have 25

Exception Management:
throwsExceptionFunc |> should (throw_exception<ArgumentException>)
doesntThrowException |> should not_throw_exception

Future directions include the creation of a Behavior Driven Development experience in the vain of Specter, Specs, MSpec among others using F# language constructs.

Last edited Jun 19, 2008 at 10:05 PM by MatthewPodwysocki, version 7