如何在 F# 中创建单元测试?我通常使用带有 [TestClass] 和 [TestMethod] 属性的 Visual Studio 的 UnitTest 部分,并使用测试视图来运行这些.我知道我可以创建一个脚本文件并运行它们,但我喜欢它当前的处理方式.
How do you create unit tests in F#? I typically use the UnitTest portion of Visual Studio with a [TestClass] and [TestMethod] attributes and use the Test View to run these. I know I can just create a script file and run these, but I like the way that it is currently handled.
推荐答案我宁愿使用 FsUnit 或者 FsTest 用 F# 写测试,感觉比 OO xUnit 样式测试.
I'd rather use FsUnit or FsTest to write tests in F#, it feels more natural than OO xUnit style tests.
EDIT 2014:我现在认为 FsUnit/FsTest 基本上是无用的语法糖.比 OO 更自然"并不绝对意味着什么.几个月前,我在这里写了我目前关于测试的想法a>(我建议阅读整个线程).
EDIT 2014: I now consider FsUnit/FsTest to be mostly useless syntax sugar. And "more natural than OO" doesn't mean absolutely anything. A few months ago I wrote my current thoughts on testing here (I recommend reading the entire thread).
更多推荐
如何在 F# 中处理单元测试?
发布评论