MSTest, NUnit, xUnit v3 ve TUnit için VSTest ve MTP arasında test filtreleri oluşturma ve dönüştürme işlemlerinde referans sözdizimi sağlar.
- GitHub yıldızları
- 5.942
- Dosyalar
- 1
- Son commit
- 11 Kas 2026
- Lisans
- MIT
- İzin verilen araçlar
- —
filter-syntax skill ne işe yarar?
filter-syntax bir agent skill'dir. MSTest, NUnit, xUnit v3 ve TUnit için VSTest ve MTP arasında test filtreleri oluşturma ve dönüştürme işlemlerinde referans sözdizimi sağlar.
Özet, skill'in SKILL.md dosyasından oluşturuldu.
filter-syntax skilli hakkında
Bu SKILL, .NET test framework'leri için test filtreleri oluşturmayı ve bunları dönüştürmeyi sağlar. VSTest veya MTP ortamları için belirli komut satırı ifadeleri oluşturması gereken geliştiriciler için bir referans sunar. Araç, doğrudan çağrılmak yerine run-tests ve mtp-hot-reload gibi araçlar için bir bakış noktası (lookup) görevi görecek şekilde, yalnızca belirli bir platform veya framework tanımlandıktan sonra yüklenecek şekilde tasarlanmıştır.
Kullanıcılar MSTest, NUnit, xUnit v3 ve TUnit için sözdizimi kurallarına erişebilirler. Tam eşleşme, contains ve AND ile OR gibi mantıksal birleştiriciler gibi operatörlerin nasıl kullanılacağını detaylandırır. SKILL ayrıca, filtreleri VSTest'ten MTP'ye taşımak için dönüştürme mantığı sunarak geliştiricilerin genel ifadeleri --filter-class veya TUnit tarafından kullanılan yol tabanlı --treenode-filter gibi framework'e özel bayraklara dönüştürmelerine yardımcı olur.
Bir agent bununla neler yapabilir
- 1VSTest filtre ifadeleri oluşturunMSTest veya NUnit kullanarak belirli bir kategorideki testleri çalıştırmak için bir komut oluşturun.
- 2Karmaşık xUnit sorgularını yürütünTestleri assembly, namespace ve trait'lere göre filtrelemek için yol segmenti sorgusu oluşturun.
Skill'in SKILL.md dosyasından yazılmıştır. Her kullanım durumu oradaki bir alıntı ile kontrol edilir.
filter-syntax skill nasıl kurulur
Her komut, skill klasörünü istemcinin skills dizinine kopyalar. Yüklemek için istemciyi yeniden başlatın veya yeni bir oturum başlatın.filter-syntax skill'ini Eklenti uygulamasına kur
/plugin marketplace add dotnet/skills /plugin install dotnet-test@dotnet-agent-skills
filter-syntax skill'ini Claude Code uygulamasına kur
~/.claude/skills/filter-syntax/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax ~/.claude/skills/filter-syntaxfilter-syntax skill'ini Claude Code (project) uygulamasına kur
.claude/skills/filter-syntax/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax .claude/skills/filter-syntaxfilter-syntax skill'ini Codex uygulamasına kur
~/.agents/skills/filter-syntax/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax ~/.agents/skills/filter-syntaxfilter-syntax skill'ini Gemini CLI uygulamasına kur
~/.gemini/skills/filter-syntax/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax ~/.gemini/skills/filter-syntaxfilter-syntax skill'ini Claude.ai uygulamasına kur
npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax filter-syntax && zip -r filter-syntax.zip filter-syntax # claude.ai → Customize → Skills → + → Create skill → Upload a skill → filter-syntax.zip
Otomatik kontroller
Çalıştırıldı 15 Kas 2026Tam rapor →Otomatik kontrollerimizi geçti. Bu bir güvenlik denetimi değil: bir ajanın çalıştırmasına izin vermeden önce betikleri okuyun. Kontroller nasıl çalışır · Daha fazla puan için nelerin düzeltileceği
- Kaynak deposu bağlantılı ve erişilebilirdotnet/skills/plugins/dotnet-test/skills/filter-syntax is public and reachablegithub.com/dotnet/skills/tree/HEAD/plugins/dotnet-test/skill ↗Geçti
- Açık kaynak lisansı (OSI)MITspdx.org/licenses/MIT.html ↗Geçti
- Son bir yıl içinde commit veya sürüm mevcutLast commit 2026-11-11github.com/dotnet/skills/commits ↗Geçti
- Betiklerde indir-çalıştır veya kimlik bilgisi hırsızlığı yokNo scripts in the skill folderGeçti
- SKILL.md içinde gizli talimat yokNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗Geçti
- Önceden izin verilen araçlar sınırlıNo pre-approved tools; the agent asks before using onegithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗Geçti
- SKILL.md, Agent Skills biçimine uyuyorthe description does not say when to use the skillgithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗Bulgu
SKILL.md
GitHub'da görüntüleTest Filter Syntax Reference
Filter syntax depends on the platform and test framework.
VSTest filters (MSTest, xUnit v2, NUnit on VSTest)
dotnet test --filter <EXPRESSION>
Expression syntax: <Property><Operator><Value>[|&<Expression>]
Operators:
| Operator | Meaning |
|---|---|
= |
Exact match |
!= |
Not exact match |
~ |
Contains |
!~ |
Does not contain |
Combinators: | (OR), & (AND). Parentheses for grouping: (A|B)&C
Supported properties by framework:
| Framework | Properties |
|---|---|
| MSTest | FullyQualifiedName, Name, ClassName, Priority, TestCategory |
| xUnit | FullyQualifiedName, DisplayName, Traits |
| NUnit | FullyQualifiedName, Name, Priority, TestCategory |
An expression without an operator is treated as FullyQualifiedName~<value>.
Examples (VSTest):
# Run tests whose name contains "LoginTest"
dotnet test --filter "Name~LoginTest"
# Run a specific test class
dotnet test --filter "ClassName=MyNamespace.MyTestClass"
# Run tests in a category
dotnet test --filter "TestCategory=Integration"
# Exclude a category
dotnet test --filter "TestCategory!=Slow"
# Combine: class AND category
dotnet test --filter "ClassName=MyNamespace.MyTestClass&TestCategory=Unit"
# Either of two classes
dotnet test --filter "ClassName=MyNamespace.ClassA|ClassName=MyNamespace.ClassB"
MTP filters — MSTest and NUnit
MSTest and NUnit on MTP use the same --filter syntax as VSTest (same properties, operators, and combinators). The only difference is how the flag is passed:
# .NET SDK 8/9 (after --)
dotnet test -- --filter "Name~LoginTest"
# .NET SDK 10+ (direct)
dotnet test --filter "Name~LoginTest"
MTP filters — xUnit (v3)
xUnit v3 on MTP uses framework-specific filter flags instead of the generic --filter expression:
| Flag | Description |
|---|---|
--filter-class "name" |
Run all tests in a given class |
--filter-not-class "name" |
Exclude all tests in a given class |
--filter-method "name" |
Run a specific test method |
--filter-not-method "name" |
Exclude a specific test method |
--filter-namespace "name" |
Run all tests in a namespace |
--filter-not-namespace "name" |
Exclude all tests in a namespace |
--filter-trait "name=value" |
Run tests with a matching trait |
--filter-not-trait "name=value" |
Exclude tests with a matching trait |
Multiple values can be specified with a single flag: --filter-class Foo Bar.
# .NET SDK 8/9
dotnet test -- --filter-class "MyNamespace.LoginTests"
# .NET SDK 10+
dotnet test --filter-class "MyNamespace.LoginTests"
# Combine: namespace + trait
dotnet test --filter-namespace "MyApp.Tests.Integration" --filter-trait "Category=Smoke"
xUnit v3 query filter language
For complex expressions, use --filter-query with a path-segment syntax:
/<assemblyFilter>/<namespaceFilter>/<classFilter>/<methodFilter>[traitName=traitValue]
Each segment matches against: assembly name, namespace, class name, method name. Use * for "match all" in any segment. Documentation: https://xunit.net/docs/query-filter-language
# xUnit.net v3 MTP — using query language (assembly/namespace/class/method[trait])
dotnet test -- --filter-query "/*/*/*IntegrationTests*/*[Category=Smoke]"
MTP filters — TUnit
TUnit uses --treenode-filter with a path-based syntax:
--treenode-filter "/<Assembly>/<Namespace>/<ClassName>/<TestName>"
Wildcards (*) are supported in any segment. Filter operators can be appended to test names for property-based filtering.
| Operator | Meaning |
|---|---|
* |
Wildcard match |
= |
Exact property match (e.g., [Category=Unit]) |
!= |
Exclude property value |
& |
AND (combine conditions) |
| |
OR (within a segment, requires parentheses) |
Examples (TUnit):
# All tests in a class
dotnet run --treenode-filter "/*/*/LoginTests/*"
# A specific test
dotnet run --treenode-filter "/*/*/*/AcceptCookiesTest"
# By namespace prefix (wildcard)
dotnet run --treenode-filter "/*/MyProject.Tests.Api*/*/*"
# By custom property
dotnet run --treenode-filter "/*/*/*/*[Category=Smoke]"
# Exclude by property
dotnet run --treenode-filter "/*/*/*/*[Category!=Slow]"
# OR across classes
dotnet run --treenode-filter "/*/*/(LoginTests)|(SignupTests)/*"
# Combined: namespace + property
dotnet run --treenode-filter "/*/MyProject.Tests.Integration/*/*/*[Priority=Critical]"
VSTest → MTP filter translation (for migration)
MSTest, NUnit, and xUnit.net v2 (with YTest.MTP.XUnit2): The VSTest --filter syntax is identical on both VSTest and MTP. No changes needed.
xUnit.net v3 (native MTP): xUnit.net v3 does NOT support the VSTest --filter syntax on MTP. Translate filters using xUnit.net v3's native options:
VSTest --filter syntax |
xUnit.net v3 MTP equivalent | Notes |
|---|---|---|
FullyQualifiedName~ClassName |
--filter-class *ClassName* |
Wildcards required for substring match |
FullyQualifiedName=Ns.Class.Method |
--filter-method Ns.Class.Method |
Exact match on fully qualified method |
Name=MethodName |
--filter-method *MethodName* |
Wildcards for substring match |
Category=Value (trait) |
--filter-trait "Category=Value" |
Filter by trait name/value pair |
| Complex expressions | --filter-query "expr" |
Uses xUnit.net query filter language (see above) |
Bu becerideki dosyalar
1filter-syntax skill soruları
filter-syntax skill'ini Claude Code uygulamasına nasıl kurarım?
npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax ~/.claude/skills/filter-syntax komutunu çalıştırın. Claude Code, skill'leri ~/.claude/skills (tüm projeler) veya .claude/skills (tek proje) konumundan yükler ve açıklaması görevle eşleştiğinde skill'i kullanır.
filter-syntax skill'ini hangi istemciler kullanabilir?
Agent Skills biçimini okuyan her istemci: Claude Code, Codex, Gemini CLI ve claude.ai (ZIP olarak yükleyin). Skill içindeki betikler yalnızca istemcinin kod çalıştırmaya izin verdiği yerlerde çalışır.
VSTest kullanarak belirli bir kategorideki testleri nasıl çalıştırabilirim?
TestCategory özelliğini tam eşleşme operatörü ile kullanabilirsiniz, örneğin: dotnet test --filter "TestCategory=Integration".
MTP üzerindeki xUnit v3, standart VSTest filtre sözdizimini destekliyor mu?
Hayır, MTP üzerindeki xUnit v3 standart VSTest --filter sözdizimini desteklemez; framework'e özel bayrakların veya --filter-query seçeneğinin kullanılmasını gerektirir.
TUnit tree node filtreleme sözdizimi nedir?
TUnit yol tabanlı bir sözdizimi kullanır: --treenode-filter "/<Assembly>/<Namespace>/<ClassName>/<TestName>" ve joker karakterleri (wildcards) destekler.