在.NET 2.0+中使用生成后事件执行带有MS测试的单元测试 [英] Using Post-Build Event To Execute Unit Tests With MS Test in .NET 2.0+

查看:77
本文介绍了在.NET 2.0+中使用生成后事件执行带有MS测试的单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在.NET 3.5中设置一个构建后事件,该事件将运行带有MS测试的单元测试套件.我发现帖子指出显示了如何使用MbUnit调用bat文件,但是我想查看是否有人通过MS Test完成了这种事情?

I'm trying to setup a post-build event in .NET 3.5 that will run a suite of unit tests w/ MS test. I found this post that shows how to call a bat file using MbUnit but I'm wanting to see if anyone has done this type of thing w/ MS Test?

如果是这样,我会对bat文件的外观示例感兴趣

If so, I would be interested in a sample of what the bat file would look like

推荐答案

我们以相同的样式使用NUnit,因此决定移至MSTest.这样做时,我们只是将以下内容添加到了适用的MSTest项目的Post-Build事件中:

We were using NUnit in the same style and decided to move to MSTest. When doing so, we just added the following to our Post-Build event of the applicable MSTest project:

CD $(TargetDir)
"$(DevEnvDir)MSTEST.exe" /testcontainer:$(TargetFileName)

完整的MSTest命令行选项集可以在适用的MSDN网站上找到.

The full set of MSTest command line options can be found at the applicable MSDN site.

这篇关于在.NET 2.0+中使用生成后事件执行带有MS测试的单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆