4

I have been trying to use fsunit to test a project. If I limit myself to [<TestMethod>] methods they all show up in the TestExplorer. However, if I try to use [<TestCase(...)>] nothing shows up and no tests get executed.

I expect I have something wrong in my setup but I have no clue as to what it could be. I have NUnit.Framework as well as FsUnit referenced in my code.

This is using Visual Studio 2013, BTW.

An example of what I am trying to do (with a toy Factorial function):

open NUnit.Framework
open FsUnit

[<TestFixture>]
type ``Given the Fact function``()=

    [<TestCase(1,1)>]
    [<TestCase(2,2)>]
    [<TestCase(3,6)>]
    ...
    member t.``the result is calculated correctly``(n, expected) = 
        let actual = Fact n 
        actual |> should equal expected

I have tried replacing TestFixture with TestClass but this doesn't seem to do any good, either.

Mark

melston
  • 2,198
  • 22
  • 39

1 Answers1

3

I got the question answered by Tomas Petricek in an email exchange. It turns out that I had to do more than download the NUnit and FsUnit frameworks to make this work. I also had to download and install the NUnit VsTestAdapter to make it work with the MS testing framework.

This information was actually on the NUnit web site but I just didn't know where to look to find it.

Thanks, Tomas.

GregC
  • 7,737
  • 2
  • 53
  • 67
melston
  • 2,198
  • 22
  • 39