gpt4 book ai didi

c# - vstest.console 可以通过提供特征来过滤测试运行吗?

转载 作者:行者123 更新时间:2023-11-30 23:32:16 25 4
gpt4 key购买 nike

我喜欢从 Visual Studio 运行一组特定的测试,按特征过滤它们。例如:

Traits on Visual Studio

我担心的是我如何为 vstest.console 提供基于特征的过滤器?

实际上,我正在尝试使用 Team Foundation Server 2015 上新的可编写脚本的构建系统来改进持续集成构建,并且我想根据软件层或层分离测试步骤(显然我已经组织了我的测试通过使用 [TestCategory] 属性的特征)。

最佳答案

经过一些试错,答案是是的,可以为 vstest.console 提供测试过滤器。

您需要使用/TestCaseFilter 命令行开关。例如,在我的例子中,我提供了 /TestCaseFilter:"TestCategory=rest"

this MSDN article 上有解释它指出:

Run tests that match the given expression. is of the format =[|]. Example: /TestCaseFilter:"Priority=1" Example: /TestCaseFilter:"TestCategory=Nightly|FullyQualifiedName=Namespace.ClassName.MethodName"

关于c# - vstest.console 可以通过提供特征来过滤测试运行吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34351513/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com