c# - 从 dotnet 测试中排除命名空间

标签 c# unit-testing .net-core command-line-interface xunit

我们如何从 dotnet test 中排除特定命名空间?

dotnet test --filter ExcellentQualifiedName~Namespace.Here 适用于包含命名空间,但 !~ 无法识别排除命名空间。

最佳答案

根据https://learn.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests?pivots=mstest您需要转义感叹号:

Using filters that include exclamation mark ! on *nix requires escaping since ! is reserved.

所以我想你需要这样做:

dotnet test --filter FullyQualifiedName\!~Namespace.Here

关于c# - 从 dotnet 测试中排除命名空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57255567/

相关文章:

Oracle DB 与 .NET Core 使用 ODP.Net Provider - 如何设置架构

c# - 如何获取泛型类型参数的类型名称?

c# - 数组索引与指针算术性能

javascript - ECMAScript 5 支持测试套件

.net-core - DocFX(在 Azure DevOps 中): The imported project "\15.0\Microsoft.Common.props" was not found

c# - 是否可以将 IHttpClientFactory 注入(inject)强类型客户端?

c# - 用于查找数组中少数元素之和的 ParallelFor 代码(子集问题)

C# 将用户输入匹配到数组

unit-testing - XCTestCase 的意外行为 - 创建不同的实例来运行测试方法

ios - 如何在我的 Firebase 数据库中分离测试和生产数据?