Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unit test F# code in Visual Studio 2008?

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?
like image 331
Jader Dias Avatar asked Nov 30 '22 12:11

Jader Dias


1 Answers

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.

like image 193
MichaelGG Avatar answered Dec 04 '22 13:12

MichaelGG