【问题标题】:running fsUnit tests from visual studio从 Visual Studio 运行 fsUnit 测试
【发布时间】:2010-10-25 16:52:12
【问题描述】:

所以我在 Visual Studio 中编写了我的第一个 fsUnit 测试。它只是 NUnit 框架的扩展,我一直在使用 NUnit 在 C# 中进行 TDD。在 C# 中编写测试时,我可以从 Visual Studio 运行测试但我无法从 VS 运行 f# 测试。为什么是这样 ?是否有任何其他工具可用于(外部)运行测试?

【问题讨论】:

    标签: unit-testing f# fsunit


    【解决方案1】:

    fsUnit 只是一个库,它允许您使用组合器编写单元测试的主体,但单元测试的其余部分可以编写为普通类(具有普通属性)。如果您编写如下内容,那么 NUnit 测试运行程序应该会看到它(例如,在某个项目中的文件 Tests.fs 中):

    open FsUnit
    open NUnit.Framework
    
    [<TestFixture>]
    type AccountTest() =
      [<Test>]
      member x.SimpleTest() = 
        1 |> should equal 1
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多