Visual-studio – How to unit test F# code in Visual Studio 2008

%funit testingvisual-studio-2008visual-studio-2008-sp1

I'm new to F# and I intend to create new F# project, and unit test it with F# in Visual Studio 2008, but the Visual Studio 2008 Unit Test Wizard don't have a F# test project option (just have C, C# and VB options).

  1. Is it possible to unit test F#?
  2. Is it possible to unit test F# with a F# test project?
  3. Is it possible to unit test F# with a F# test project in Visual Studio 2008?
  4. How to do it, if there is no Wizard in Visual Studio 2008?

Best Answer

This link describes using the VS testing system with F#. You do it pretty much the same way as with C#.

The downside is that apparently the VS IDE won't automatically pick it up -- I believe you need to run from the command line using mstest.exe.

Edit: Oh, another cool thing with F#, is FsCheck. This allows you to write simple tests, and have the FsCheck system try to disprove them via random testing.