Auto-generation of .NET unit tests(自动生成 .NET 单元测试)
问题描述
是否存在单元测试生成之类的东西?如果是这样……
Is there such a thing as unit test generation? If so...
...效果好吗?
...可用于 .NET 的自动生成解决方案有哪些?
...What are the auto generation solutions that are available for .NET?
...有使用这种技术的例子吗?
...are there examples of using a technology like this?
...这仅适用于某些类型的应用程序,还是可以用来替代所有手动编写的单元测试?
...is this only good for certain types of applications, or could it be used to replace all manually written unit testing?
推荐答案
看看 Pex.它是微软研究项目.来自网站:
Take a look at Pex. Its a Microsoft Research project. From the website:
Pex 通过基于动态符号执行的自动探索性测试从手写参数化单元测试生成单元测试.
如评论中所述,Pex 现在称为 IntelliTest 是 Visual Studio 企业版的一项功能.它支持以 MSTest、MSTest V2、NUnit 和 xUnit 格式发出测试,并且具有可扩展性,因此您可以将其与其他单元测试框架一起使用.
As mentioned in the comments, Pex is now called IntelliTest and is a feature of Visual Studio Enterprise Edition. It supports emitting tests in MSTest, MSTest V2, NUnit, and xUnit format and it is extensible so you can use it with other unit test frameworks.
但请注意以下注意事项:
But be aware of the following caveats:
- 仅支持面向 .NET Framework 的 C# 代码.
- 不支持 x64 配置.
- 在 Visual Studio 中可用仅限企业版
这篇关于自动生成 .NET 单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:自动生成 .NET 单元测试


基础教程推荐
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 将 XML 转换为通用列表 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- c# Math.Sqrt 实现 2022-01-01