Is it possible to use MSTest with F# in VS2010. People has asked this question many times. But I can't seem to find a solution among the answers. Has anybody been able to use MSTest for F# unit testing or should I stick to NUnit?
Yes, you can use MsTest with F# in VS2010. At the most basic level, using the [<TestClass>], [<TestMethod>] and related attributes will allow you to run tests from the command line using mstest (in a VS command prompt window). In addition, if you use the trick described here: http://www.atrevido.net/blog/2010/05/07/F+Unit+Testing+With+Visual+Studio+2010.aspx, you will be able to use about 95% of the VS2010 support for unit tests.
In particular, you can use the Test List Editor, run tests from VS2010 in normal or debug mode, and view test results within VS2010.
If supported by your VS2010 edition, code coverage will also work for F# unit tests.
One feature that doesn't work is navigating to the source of a unit test by double-clicking on the test from the test result viewer.
I've also been able to combine MSTest and FsCheck tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With