Back in June, I announced the creation of FsTest, a testing Domain Specific Language for F#. Since that time, the F# team has released the September 2008 CTP, which finally gives F# full citizenship within Visual Studio with real project files. I felt it was time to update FsTest, and more in particular, FsxUnit, which uses xUnit.net as the back end for doing assertions. Go ahead and pick up the latest bits here from the CodePlex site.





What’s Changed?

Other than migrating the code to the new F# project formats, the migration was rather smooth. As I have mentioned before, order still matters in your F# projects. But luckily Visual Studio now gives you the opportunity to not only add files above and below, but to move files up and down as well, as shown below:

Code changes were pretty minimal. There were a few instances in which I had to change the method signature slightly in the interface file, such as the following.

Before

/// Determine whether the collection is empty

val Empty : # System . Collections . IEnumerable -> unit

After

/// Determine whether the collection is empty

val Empty : System . Collections . IEnumerable -> unit

The difference between the two being that the before has a signature which looks like this:

val Empty<‘a when ‘a : > System . Collections . IEnumerable>

And having it specified that way does not work properly, whereas it did in the previous versions of F#. There were several instances I removed the # in front of the seq and IEnumerable classes. Note that none of the calling code in any of my tests had to change one bit, so if you’ve been using it, there should be no issues arising.

Since the time I unveiled FsTest, xUnit.net, my favorite unit testing framework, has released version 1.02, which covered minor bug fixes. After updating the references and fixing those slight issues, I’m able to run the xUnit.net GUI runner and get the green lights which is always joy:





Where to Go From Here?

So, where do I go from here? I’m still looking to move this more towards a BDD style, instead of just the DSL syntax for the assertions. Taking some ideas still from RSpec and Scala Specs is my goal to make this a more complete solution. It’s still a work in progress, but the real question, what works for you? What doesn’t? Where should it go? I have some ideas, but feedback is always appreciated.