tunit
Skill508 starsChanged 8 days agoMITView on GitHub
Write or troubleshoot tests using TUnit, TUnit.Assertions, or TUnit.Mocks, or migrate tests to TUnit. Routes to task-specific official documentation. Use only for tasks involving these packages or migration to TUnit.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- thomhurst/TUnitedited, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- thomhurst/TUnit★ 4k94% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-framework-builder-dotnetSkill
- aspire-deploymentSkill
- aspire-monitoringSkill
- aspire-orchestrationSkill
- aspireSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use this skill to find the TUnit guidance needed for the current task.
- Very specific: line 13
Check the relevant project files for TUnit package versions, target frameworks, and the SDK/test runner in global.json.
- Very specific: line 16
Follow related links only to resolve a specific gap.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TUnit
Use this skill to find the TUnit guidance needed for the current task. Fetch documentation with an available web tool or HTTP client; network access is required. The documentation contains the API details and examples; do not load the whole site.
Load only what the task needs
- Check the relevant project files for TUnit package versions, target frameworks, and the SDK/test runner in
global.json. Include centrally managed package versions when present. Preserve the project's versions unless an upgrade is requested or necessary and explained. - Choose the closest topic below and fetch that Markdown page before choosing APIs or commands. Start with one page; fetch another only when the task needs it. Skip pages already available in the conversation unless they need refreshing.
- For an unlisted topic or a broken route, fetch the documentation index, search it for the feature or diagnostic, then fetch only the matching page. Do not fetch
llms-full.txtor crawl every link. - Follow related links only to resolve a specific gap. Prefer the
.mdversion: remove a trailing slash and append.mdto an HTML documentation path, before any fragment. Keep existing.mdpaths unchanged. Resolve relative links against the fetched page's URL. - Apply the relevant example to the existing project and run a focused build or test when making code changes. Cite the documentation used. If current documentation differs from the installed API, check version-matched source or local API evidence before proposing an upgrade. If fetching fails, use available local documentation and state what could not be verified; do not guess APIs.
Topic routes
Choose the link that matches the task; these are alternatives, not a reading checklist.
| Task | Documentation |
| Create or configure a project | Installation |
| Write a basic test | First test |
| Assertions, exceptions, or assertion composition | Assertions |
| Parameterized tests | Arguments, method data, or matrix data |
| Setup, teardown, or hooks | Lifecycle |
| Fixtures, shared resources, or dependency injection | Class data sources or dependency injection |
| Concurrency or dependencies between tests | Parallelism or ordering |
| Run tests or select tests | Running tests or filters |
| Migrate an existing suite | xUnit, NUnit, or MSTest, matching the source framework |
| Mocking | TUnit.Mocks |
| Aspire integration testing | Aspire |
| ASP.NET Core integration testing | ASP.NET Core |
| Playwright browser testing | Playwright |
| Testcontainers and container fixtures | ASP.NET Core integration examples (see "With Testcontainers") |
| Native AOT, trimming, or reflection mode | AOT compatibility or engine modes |
| Custom assertions | Assertion source generators or custom assertion implementations |
| Custom data sources | Data source generators |
| Event receivers | Event subscribing |
| TestContext and test metadata | Test context |
| Diagnostics, output, or tracing | Logging, test artifacts, or OpenTelemetry |
| Cancellation | Cancelling a test |
| Discovery, build, or execution failures | Troubleshooting |
For other topics, such as analyzers or framework-specific integrations, use the index selectively.
Essential distinctions
- Await TUnit assertions, for example
await Assert.That(actual).IsEqualTo(expected);. - Tests run in parallel by default. Account for shared mutable state and resource lifetimes.
- TUnit uses Microsoft.Testing.Platform and
--treenode-filter. Match command syntax to the project's SDK and runner mode; do not substitute VSTest--filteror assume everydotnet testinvocation needs a--separator. - Source-generated discovery is the default; reflection mode also exists. Check the relevant documentation when changing discovery or Native AOT behavior.
- TUnit.Assertions and TUnit.Mocks also work with other test frameworks. Using them alone does not require changing the project's test runner.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

