4

So i wrote my first fsUnit test in Visual studio. It is just an extension to the NUnit framework and I have been using NUnit from doing TDD in C#. While writing tests in c#, I am able to run the tests from visual studio But I am not able to run f# tests from VS. why is this ? Are there any other tools which i can use to run the tests (externally)?

M Falanga
  • 1,897
  • 17
  • 21
gprasant
  • 15,589
  • 9
  • 43
  • 57

1 Answers1

3

fsUnit is just a library that allows you to write the body of the unit test using combinators, but the rest of the unit test can be written as a usual class (with the usual attributes). If you write something like the following then the NUnit test runner should see it (e.g. in a file Tests.fs in some project):

open FsUnit
open NUnit.Framework

[<TestFixture>]
type AccountTest() =
  [<Test>]
  member x.SimpleTest() = 
    1 |> should equal 1
Tomas Petricek
  • 240,744
  • 19
  • 378
  • 553