Microsoft F# and TestDriven.Net 2.16
Now that F# is being officially productized, I thought it was time to make it a first class citizen inside TestDriven.Net.
When learning a new language I like to experiment by writing ad-hoc tests and viewing my code inside .NET Reflector. My initial focus has been getting 'Go To Reflector' and the targeting of parameterless methods and properties working.
You can get the latest release of F#, including the compiler, tools, and Visual Studio 2008 integration from the F# Developer Center. You will also need TestDriven.Net 2.16 or above.
The F# team has put together a collection of F# sample code. The samples come with their own 'F# Micro Samples Explorer' application, but they are also ideal for running as ad-hoc tests. In particular have a look at the 'beginners.fs' and 'intermediate.fs' modules in the 'Samples101' project.
To view the code using .NET Reflector, simply right click inside a method, property, module or project and 'Go To Reflector'.
At the moment only parameterless methods and properties are supported. This is due to the way F# makes extensive use of type inferencing for parameters. Luckily it is parameterless methods and properties that it makes most sense to target for evaluation or running as unit tests. I'll talk more about unit testing F# code in a future post.