I've started playing around with F# again and decided to try and create some unit tests around the examples I'm following from Real World Functional Programming. After reading Matt Podwysocki's blog post about XUnit.NET I decided that would probably be the best framework for me to use.
The example I'm writing tests around is:
let convertDataRow(str:string) =
let cells = List.of_seq(str.Split([|','|]))
...
I started driving that out from scratch but ran into a problem trying to assert the error case when an invalid data format is passed in.
The method to use for the assertion is 'Assert.ShouldThrow' which takes in an Assert.ThrowsDelegate which takes in an argument of type unit->unit.
No comments yet, be the first one to post comment.