实时单元测试排除测试 [英] Live unit testing exclude tests

查看:30
本文介绍了实时单元测试排除测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以通过右键单击测试项目并选择Live Unit Testing"上下文菜单来从 Live Unit Testing 中排除整个测试项目.

I know it is possible to exclude the whole test project(s) from Live Unit Testing by right clicking on the test project and selecting the "Live Unit Testing" context menu.

但在我的解决方案中,我有一些长时间运行/资源密集型测试,我想排除这些测试.是否可以排除个别测试?

But in my solution I have some long running/resource intensive tests, which I would like to exclude. Is it possible to exclude individual tests?

推荐答案

最简单的方法是右键单击编辑器视图中的方法并选择 Live Unit Testing and Exclude.

Easiest method is right clicking on the method in the editor view and selecting Live Unit Testing and Exclude.

您也可以使用属性以编程方式执行此操作.

You can also do it programatically with attributes.

对于 xUnit:[Trait("Category", "SkipWhenLiveUnitTesting")]

对于 NUnit:[Category("SkipWhenLiveUnitTesting")]

对于 MSTest:[TestCategory("SkipWhenLiveUnitTesting")]

更多信息位于 微软文档

这篇关于实时单元测试排除测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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