我一直在尝试使用 fsunit 来测试一个项目。如果我将自己限制在[<TestMethod>]
方法上,它们都会出现在 TestExplorer 中。但是,如果我尝试不使用[<TestCase(...)>]
任何东西,也不会执行任何测试。
我希望我的设置有问题,但我不知道它可能是什么。我的代码中引用了 NUnit.Framework 和 FsUnit。
这是使用 Visual Studio 2013,顺便说一句。
我正在尝试做的一个例子(使用玩具阶乘函数):
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
我尝试过替换TestFixture
,TestClass
但这似乎也没有任何好处。
标记