Skills

Cscheck

Write and simplify C# property-based, model-based, and executable specification tests...

Install

npx skills add Aaronontheweb/dotnet-skills --skill cscheck -g -a claude-code -y
Category
Testing
Updated
7d ago
License
MIT
Context cost
Lightabout 1,099 tokens
Runs scripts
No, instructions only

What it does

Write and simplify C# property-based, model-based, and executable specification tests with CsCheck. Use for generators, shrinking, stateful command sequences, Spec guards and rules, implementation conformance, or replaying generated failures.

CsCheck

Use CsCheck to explore inputs and action sequences; keep the application's contract visible in the test. Let the library generate, shrink, print, and replay counterexamples. Start with the smallest test that can falsify the claim, rather than building a testing framework around CsCheck.

Choose the test shape

What needs checkingStart withRead when needed
A function, round trip, algebraic law, or data transformationGen + SampleProperties and generators
An implementation with a simpler reference representationSampleModelBased / SampleModelBasedAsyncStateful and async tests
A protocol or lifecycle with explicit state, guards, and requirementsSpec.From, then Exhaustive and ConformExecutable specifications
Async resources or expectations that must incorporate observed outcomesGenerated command arrays + SampleAsync, with cleanup inside each caseStateful and async tests
A failing property, seed replay, or a before/after bug demonstrationNative sampling controls and a concrete regressionFailure discovery and replay

Read only the references needed for the task. These examples use xUnit, but CsCheck itself is test-framework independent. Preserve the project's existing framework and package-management conventions.

Establish the contract first

Identify an observable requirement and a plausible wrong result it would reject. Separate generated inputs, expected behavior, and actual observations. A model may consume observations, but must validate them against prior expectations before accepting them as new state. Do not use the implementation's answer to manufacture its expected answer.

Read the whole SKILL.md on GitHub

More in Testing