unit-testing
Skill1 starsChanged 5 months agoMITView on GitHub
Guides unit test setup, naming, TestOf usage, Arrange/Act/Assert structure, ServiceLocator initialization, and Shouldy assertions. Use when adding, reviewing, or fixing unit tests.
23 other projects use a version of this.
Adopted by
Most recently taken up by
- godfreynolan/skillstheir own version, first seen Nov 29, 2026
- naomiaro/waveform-playlisttheir own version, first seen Nov 16, 2026
- lengrufeng2008/dsh-skill-librarytheir own version, first seen Nov 15, 2026
- iamcaominhtien/kanban-board-mcptheir own version, first seen Nov 13, 2026
- reddygopalkrishna/developer-agent-skillstheir own version, first seen Nov 8, 2026
- petrkindlmann/qa-skillstheir own version, first seen Oct 25, 2026
Used with
Projects with it also use database-testing, contract-testing and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
petrkindlmannSkilldatabase-testing
Validate database integrity, test migrations forward and backward, verify schema constraints, manage seed data, detect migration drift, and identify query performance issues. Covers PostgreSQL, MySQL, MongoDB with Prisma, TypeORM, Drizzle, and SQLAlchemy, plus Testcontainers test databases. Use when: "database test," "migration test," "migration rollback," "rollback test," "data integrity," "SQL test," "schema validation," "seed data," "query performance," "Testcontainers." Not for: synthetic data generation/masking at scale — use test-data-management; Docker/IaC test-environment provisioning — use test-environments; SQL injection — use security-testing. Related: test-data-management, test-environments, security-testing, ci-cd-integration.
Also in 3 projects that use this
petrkindlmannSkillcontract-testing
Implement consumer-driven contract testing with Pact-JS (v16). Covers consumer test writing, broker-driven provider verification, Pact Broker setup, can-i-deploy as a deployment gate, webhook-triggered verification, pending pacts, and schema-first vs consumer-first approaches (OpenAPI/Ajv, Schemathesis). Use when: "contract test," "Pact," "consumer-driven," "API contract," "provider verification," "can-i-deploy." Not for: stubbing or mocking a dependency to isolate a test — use service-virtualization; general REST/GraphQL endpoint assertions against your own API — use api-testing. Related: api-testing, service-virtualization, ci-cd-integration, test-environments.
Also in 3 projects that use this
ElasticSkillintegration-testing
Use when creating, running, or debugging elastic-package tests — pipeline fixture authoring and expected output, system tests with mock API wiring, and script tests for failure paths and upgrades. Load the reference file for the test type you are working on.
Also in 3 projects that use this
jarosser06Skilltest-strategy
Plans pytest test strategies for Drift's 90%+ coverage requirement using coverage analysis, edge case identification, and test suite design. Use when determining what tests to write, analyzing coverage gaps, or planning test strategies.
Also in 4 projects that use this
meteorSkille2e-testing
Use when designing, adding, reviewing, or debugging Meteor E2E tests in tools/e2e-tests, or maintaining their app/skeleton coverage report. Covers fixture selection, meaningful assertions, lifecycle helpers, isolation, CI grouping, and coverage documentation. Use testing for shared test-value and change-scope rules and choosing another test layer.
Also in 5 projects that use this
Microsoft AzureSkillrelease-readiness
Complete ODIN release documentation and validation checks before declaring user-visible work complete, preparing a release, or opening the Release-to-main pull request.
Also in 3 projects that use this
Other versions23 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 23
- pulsejet/memories★ 3.9ksame name
- naomiaro/waveform-playlist★ 1.7ksame name
- lichtblick-suite/lichtblick★ 1.3ksame name
- javierbrea/eslint-plugin-boundaries★ 1ksame name
- petrkindlmann/qa-skills★ 274same name
- kid-sid/claude-spellbook★ 190same name
- reddygopalkrishna/developer-agent-skills★ 8same name
- dprakash2101/dotnet-production-agent-skills★ 4same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- sb-dev/narrative-production-skills★ 2same name
13 more not listed
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 repository73 other files it gives its agents.
- unsafe-checker/AGENTS.mdAGENTS.md
- activity-tracingSkill
- beadsSkill
- code-analysis-warningsSkill
- coding-guidelinesSkill
- compiler-warningsSkill
- core-actionbookSkill
- core-agent-browserSkill
- core-dynamic-skillsSkill
- core-fix-skill-docsSkill
- csharp-compiler-warningsSkill
- csharp-object-designSkill
- domain-cliSkill
- domain-cloud-nativeSkill
- domain-embeddedSkill
- domain-fintechSkill
- domain-iotSkill
- domain-mlSkill
- domain-webSkill
- dotnet-pinvokeSkill
- dreamSkill
- gitSkill
- ide-warningsSkill
- karpathy-guidelinesSkill
- m01-ownershipSkill
- m02-resourceSkill
- m03-mutabilitySkill
- m04-zero-costSkill
- m05-type-drivenSkill
- m06-error-handlingSkill
- m07-concurrencySkill
- m09-domainSkill
- m10-performanceSkill
- m11-ecosystemSkill
- m12-lifecycleSkill
- m13-domain-errorSkill
- m14-mental-modelSkill
- m15-anti-patternSkill
- mermaidSkill
- meta-cognition-parallelSkill
- modern-csharpSkill
- msbuild-warningsSkill
- mx-creative-keypadSkill
- nuget-warningsSkill
- nullability-warningsSkill
- rcs-warningsSkill
- renpySkill
- rust-call-graphSkill
- rust-code-navigatorSkill
- rust-dailySkill
- rust-deps-visualizerSkill
- rust-google-styleSkill
- rust-learnerSkill
- rust-object-designSkill
- rust-refactor-helperSkill
- rust-routerSkill
- rust-skill-creatorSkill
- rustSkill
- rust-symbol-analyzerSkill
- rust-trait-explorerSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 19 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Use Shouldy for assertions.
- Very specific: line 62
Use [TestOf(typeof(ClassName))] on test classes to indicate the class under test.
- Very specific: line 63
Use [TestOf(typeof(ClassName), nameof(ClassName.MethodName))] or [TestOf(typeof(ClassName), nameof(ClassName.PropertyName))] for nested …
- Very specific: line 64
Use the ILObjectNames class for special .NET objects like operators and constructors.
“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Unit Testing
Test setup
- You may need to initialize a unit test with a
ServiceLocator. Especially for logging:
[TestOf(typeof(SettingsProvider), nameof(SettingsProvider.LoadSettings))]
public sealed class LoadSettingsTests: IDisposable
{
public LoadSettingsTests(ITestOutputHelper testOutputHelper)
{
ServiceLocator.Cleanup();
ServiceLocator.Initialize(services =>
{
services.AddLogging(logger =>
{
logger.SetMinimumLevel(LogLevel.Debug);
logger.AddXUnit(testOutputHelper);
});
});
}
public void Dispose() => ServiceLocator.Cleanup();
// tests come here...- The name of a test (
Fact/Theory) should start with the name "Should", followed by the expected result and the action taken. Setting theDisplayNameproperty improves readability.
[Fact(DisplayName = "Should return user settings when invoked")]
public void ShouldReturnUserSettingsWhenInvoked()- Structure the unit tests using
// Arrange,// Actand// Assertcomments. You may also use// Cleanupor// Arrange & Actor// Act & Assertin rare situations. - Name the object beeing testet as
subjectand the (primary) result valueresult:
// Arrange
var subject = new SomeTypeUnderTest();
// Act
var result = subject.DoSomething();- Use Shouldy for assertions. Use one assertion only, but you may use
ShouldSatisfyAllConditionswhen multiple assertions are required:
result.ShouldSatisfyAllConditions(
() => /* first assertion */,
() => /* second assertion */,
() => /* third assertion */,
// add more assertions as required
);- You may also nest assertions:
result.ShouldSatisfyAllConditions(
() => result.Value.ShouldNotBeNull().ShouldBe("foobar"),
// add more assertions as required
);Usage of [TestOf] Attribute
- Use
[TestOf(typeof(ClassName))]on test classes to indicate the class under test. - Use
[TestOf(typeof(ClassName), nameof(ClassName.MethodName))]or[TestOf(typeof(ClassName), nameof(ClassName.PropertyName))]for nested test classes. - Use the
ILObjectNamesclass for special .NET objects like operators and constructors.
Examples:
[TestOf(typeof(TypeUnderTest)]
public static class TypeUnderTestTests
{
[TestOf(typeof(TypeUnderTest), ILObjectNames.Constructor)]
public sealed class ConstructorTests { /* ... */ }
[TestOf(typeof(TypeUnderTest), ILObjectNames.Deconstructor)]
public sealed class DeconstructorTests { /* ... */ }
[TestOf(typeof(TypeUnderTest), ILObjectNames.Indexer)]
public sealed class IndexerTests { /* ... */ }
[TestOf(typeof(TypeUnderTest), ILObjectNames.op_Addition)]
public sealed class AdditionOperatorTests { /* ... */ }
[TestOf(typeof(TypeUnderTest), ILObjectNames.op_MultiplicationAssignment)]
public sealed class MultiplicationAssignmentOperatorTests { /* ... */ }
[TestOf(typeof(TypeUnderTest), ILObjectNames.op_GreaterThanOrEqualAssignment)]
public sealed class GreaterThanOrEqualAssignmentOperatorTests { /* ... */ }
[TestOf(typeof(TypeUnderTest), ILObjectNames.op_Implicit)]
public sealed class ImplicitOperatorTests { /* ... */ }
[TestOf(typeof(TypeUnderTest), ILObjectNames.op_Explicit)]
public sealed class ExplicitOperatorTests { /* ... */ }
}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.

