7

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?

1

3 Answers 3

3

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Maybe TestDriven.Net will fix the issue with double-clicking on test results. (There is a trial/free for personal use version available...)
1

I think you should stick to NUnit. Have a look here: http://connect.microsoft.com/VisualStudio/feedback/details/564586/make-using-mstest-more-accessible-to-f-projects. There is no progress with that issue.

1 Comment

Well that link proves everything I guess. Thanks
1

A more up to date answer (unless still constrained to vs2010) would include

I've got Unquote working with MsTest via Daniel Mohl's mstest template

Although I have no idea if any or all of these would work against vs 2010

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.