filter-syntax

Provides test filter syntax reference for VSTest and Microsoft.Testing.Platform across .NET test frameworks.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill filter-syntax-patrick-rex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: filter-syntax
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet-test/skills/filter-syntax
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill filter-syntax-patrick-rex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Test filter syntax differs across platforms (VSTest vs Microsoft.Testing.Platform) and frameworks (MSTest, NUnit, xUnit v2/v3, TUnit), making it hard to write correct filter expressions when running or migrating .NET tests. ## Core Features & Use Cases - VSTest Filter Reference: Documents --filter expression operators, combinators, and supported properties for MSTest, xUnit v2, and NUnit. - MTP Filter Reference: Covers framework-specific flags for xUnit v3 (--filter-class, --filter-query) and TUnit (--treenode-filter) path syntax. - Migration Translation: Maps VSTest filter expressions to xUnit v3 native MTP equivalents. - Use Case: When migrating a test suite from VSTest to Microsoft.Testing.Platform with xUnit v3, look up how to translate FullyQualifiedName~ClassName into --filter-class *ClassName*. ## Quick Start Ask the AI to show the correct dotnet test filter syntax for running only tests in a specific class on xUnit v3 with Microsoft.Testing.Platform.

Frequently Asked Questions about filter-syntax

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I filter tests with dotnet test --filter?

Use dotnet test --filter with expressions like Property Operator Value, for example "Name~LoginTest" or "TestCategory=Integration". Combine conditions with | for OR and & for AND, and group with parentheses.

How to filter xUnit v3 tests on Microsoft.Testing.Platform?

xUnit v3 on MTP uses framework-specific flags instead of --filter, such as --filter-class, --filter-method, --filter-namespace, and --filter-trait. For complex expressions, use --filter-query with the xUnit query filter language.

Does VSTest filter syntax work on Microsoft.Testing.Platform?

MSTest and NUnit on MTP support the same --filter syntax as VSTest, only the flag passing differs by SDK version. xUnit v3 does not support VSTest --filter syntax and requires its native filter flags instead.

How do I translate VSTest filters to xUnit v3 MTP?

Map expressions like FullyQualifiedName~ClassName to --filter-class *ClassName* with wildcards, and trait filters like Category=Value to --filter-trait "Category=Value". Complex expressions translate to --filter-query using the xUnit query filter language.

How do I filter TUnit tests with treenode-filter?

TUnit uses --treenode-filter with a path syntax like "/Assembly/Namespace/ClassName/TestName" where * acts as a wildcard in any segment. Append property conditions such as [Category=Smoke] or [Category!=Slow] to filter by test properties.