Unit testing NUnit没有运行我的测试用例

Unit testing NUnit没有运行我的测试用例,unit-testing,f#,nunit,nunit-3.0,nunit-console,Unit Testing,F#,Nunit,Nunit 3.0,Nunit Console,我有一个测试用例,看起来像: namespace UnitTests [<TestFixture>] module ValidatorTests = [<Test>] let VerifyBasicFunctionality () = Assert.That(bool) Assert.That(bool) 当我使用-xmlConsole标志运行此程序时,我得到以下结果: <?xml version="1.0"

我有一个测试用例,看起来像:

namespace UnitTests

[<TestFixture>]
module ValidatorTests = 

    [<Test>]
    let VerifyBasicFunctionality () = 
        Assert.That(bool)
        Assert.That(bool)
当我使用
-xmlConsole
标志运行此程序时,我得到以下结果:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!--This file represents the results of running a test suite-->
<test-results name="bin/Release/UnitTests.dll" total="0" failures="0" not-run="3" date="2016-09-08" time="10:26:00">
  <environment nunit-version="2.4.8.0" clr-version="4.0.30319.42000" os-version="Unix 15.6.0.0" platform="Unix" cwd="/SOMEUSER/SOMEPATH/UnitTests" machine-name="gmaini-m.jet.local" user="SOMEUSER" user-domain="SOMELOCALBOX" />
  <culture-info current-culture="en-US" current-uiculture="en-US" />
  <test-suite name="bin/Release/UnitTests.dll" success="True" time="0.010" asserts="0">
    <results>
      <test-suite name="UnitTests" success="True" time="0.008" asserts="0">
        <results>
          <test-suite name="ValidatorTests" success="True" time="0.001" asserts="0">
            <results>
              <test-case name="UnitTests.ValidatorTests.VerifyBasicFunctionality" executed="False">
                <reason>
                  <message><![CDATA[UnitTests.ValidatorTests is an abstract class]]></message>
                </reason>
              </test-case>
              <test-case name="UnitTests.ValidatorTests.VerifyBasicOtherFunctionality" executed="False">
                <reason>
                  <message><![CDATA[UnitTests.ValidatorTests is an abstract class]]></message>
                </reason>
               </test-case>
               <test-case name="UnitTests.ValidatorTests.VerifyBasicSomeFunctionality" executed="False">
                <reason>
                  <message><![CDATA[UnitTests.ValidatorTests is an abstract class]]></message>
                </reason>
              </test-case>
            </results>
          </test-suite>
        </results>
      </test-suite>
    </results>

你知道为什么它会发现这些测试吗?我可以用
-run=“Namespace.Module.Function”
访问它们,并用
-fixture=“Namespace”
讨论fixture,但它不会运行它们?
UnitTests.ValidatorTests.VerifyBasicFunctionality是一个抽象类
是否暗示存在一些C#互操作问题

感谢您的时间:)

此修复程序是:

namespace UnitTests

[<TestFixtureAttribute>]
type ValidatorTests () =

    [<Test>]
    member __.VerifyBasicFunctionality() =
        Assert.That(bool)
        Assert.That(bool)
命名空间单元测试
[]
类型验证程序测试()=
[]
成员u uu.VerifyBasicFunctionality()=
断言(bool)
断言(bool)

基本上,使这个面向对象。所以我的假设是正确的

F#模块本质上是一个静态类,但您运行的NUnit的旧版本(实际上是古代版本)不知道静态类,并且由于.NET实现静态类的方式而将其误解为抽象类。@Charlie:对,但是Mono的macOS安装程序将NUnit 2.4.8而不是2.6.4(后者与模块兼容,前者不兼容)Mono安装2.4.8是为了自己的目的(用于构建Mono)。对于运行测试的用户来说,它不是您应该使用的。因此,NUnit 2.6.4也是传统的。请尝试NUnit 3.10.1.:-)
namespace UnitTests

[<TestFixtureAttribute>]
type ValidatorTests () =

    [<Test>]
    member __.VerifyBasicFunctionality() =
        Assert.That(bool)
        Assert.That(bool)