问题描述
我想在提供给客户的最终可执行文件中提供单元测试代码和测试运行程序.
我
通过这种方式,我可以在客户站点运行我的单元测试、功能测试和集成测试,或者帮助解决问题.
并不是说我需要证明我的问题.
Microsoft 提出的解决方法 是使用 .Net 4 的 代码契约
到目前为止,我只听说过成功 使用 NUnit 进行单元测试.你能用 NUnit 吗?
i want to ship unit test code, and the test runner, in the final executable that is given to the customer.
The problem is that Visual Studio's test system seems to be contained in the assembly:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
and this assembly doesn't ship with the .NET framework (full or client profile).
This would mean that i would not be able to run the tests on a machine that does not have Visual Studio (2010) installed.
What's the next best workaround, given the requirement of a single executable.
It's quite handy in other languages to be able to access unit tests with an advanced keyboard shortcut:
This way i can run my unit tests, my functional tests, and my integration tests at the customer site, or to aid problem solving.
Not that i need to justify my question.
The proposed workaround by Microsoft is to use .Net 4's Code Contracts
So far, I have only heard success Shipping unit tests using NUnit. Can you use NUnit?
这篇关于VS2010 中的单元测试:如何在可执行文件中发送单元测试和测试运行器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!