如何在F#中处理单元测试?

编程入门 行业动态 更新时间:2024-10-28 10:36:24
本文介绍了如何在F#中处理单元测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在F#中创建单元测试?我通常将Visual Studio的UnitTest部分与[TestClass]和[TestMethod]属性一起使用,并使用测试视图"来运行它们.我知道我可以创建一个脚本文件并运行它们,但是我喜欢它当前的处理方式.

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#中处理单元测试?

本文发布于:2023-11-14 16:16:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1587927.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单元测试   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!