Nullean.Entities.CsCheck
0.1.0-preview.1
See the version list below for details.
dotnet add package Nullean.Entities.CsCheck --version 0.1.0-preview.1
NuGet\Install-Package Nullean.Entities.CsCheck -Version 0.1.0-preview.1
<PackageReference Include="Nullean.Entities.CsCheck" Version="0.1.0-preview.1" />
<PackageVersion Include="Nullean.Entities.CsCheck" Version="0.1.0-preview.1" />
<PackageReference Include="Nullean.Entities.CsCheck" />
paket add Nullean.Entities.CsCheck --version 0.1.0-preview.1
#r "nuget: Nullean.Entities.CsCheck, 0.1.0-preview.1"
#:package Nullean.Entities.CsCheck@0.1.0-preview.1
#addin nuget:?package=Nullean.Entities.CsCheck&version=0.1.0-preview.1&prerelease
#tool nuget:?package=Nullean.Entities.CsCheck&version=0.1.0-preview.1&prerelease
Nullean.Entities.CsCheck
Test your domain from the rules you declare on it, on nine axes you have probably never considered. Built on CsCheck.
CsCheck is a very good property-testing library, and this package does not replace it. Every generator here is a CsCheck Gen<T>, every failure is a CsCheck failure (a shrunk case and a seed that replays it), and you can mix the two in one test class. If you are testing an algorithm or a pure function, use CsCheck on its own.
If you have a domain with rules (a total is never negative, cancelling twice is cancelling once, a confirmed order ships within a minute), this package turns those rules into tests.
What it adds to CsCheck
| With plain CsCheck | With this package |
|---|---|
| You write a generator for each type | GenAuto builds one from the shape of the type, with hostile values (blank strings, NaN, undefined enums, duplicate ids) mixed in by default |
| You write a property for each rule | You declare the rule (Idempotent, Monotonic, OrderIndependent, a deadline); its shape picks the property and the inputs |
| A property that passes | A check that the generated data reached the rule; a rule never exercised fails as vacuous |
| Counter-examples you think of | A counter-example per rule to show it can fire, found by search for most |
| Operations you list | The operations of your type, discovered, with arguments harvested from the value they act on |
| No clock | A virtual clock, and delays chosen from your deadlines |
Read more: what this adds to CsCheck, with the same tests written both ways.
One screen
// the rules, declared once next to the type
[Constraints]
public static partial class OrderConstraints
{
public static readonly Constraint<Order> CancelIsRepeatable = Constraints<Order>.Idempotent(o => o.Cancel());
public static readonly Constraint<Order> VersionNeverGoesBack = Constraints<Order>.Monotonic(o => o.Version, MonotonicDirection.NonDecreasing);
}
// the tests: one per axis the rules declare
public static IEnumerable<Func<AxisCase>> Axes() => AutoTest.For(OrderConstraints.Instance, orders).AsDataSource();
[Test, MethodDataSource(nameof(Axes))]
public Task EveryDeclaredAxisHolds(AxisCase axis) => axis.RunAsync();
Install
dotnet add package Nullean.Entities.CsCheck # tests only
The package does not depend on System.Reactive. If your service is built on IObservable<T>, add Nullean.Entities.CsCheck.Reactive.
Where to go next
- Getting started: five minutes, one order, one red test.
- Why and concepts in plain words.
- The nine axes and the vocabulary.
- Reference: the generators,
Script, model-based and metamorphic testing, state machines, generated data. - Source and AGENTS.md.
License: MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
-
net10.0
- Bogus (>= 35.6.5)
- CsCheck (>= 4.9.1)
- Nullean.Entities (>= 0.1.0-preview.1)
-
net11.0
- Bogus (>= 35.6.5)
- CsCheck (>= 4.9.1)
- Nullean.Entities (>= 0.1.0-preview.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Nullean.Entities.CsCheck:
| Package | Downloads |
|---|---|
|
Nullean.Entities.CsCheck.FileSystem
Generated file-system worlds for Nullean.Entities.CsCheck: AutoGen builds IFileSystem, IFileInfo and IDirectoryInfo members from one MockFileSystem per generated value, with missing, symlinked, hidden and outside-the-root files, so rules about files get counter-examples with no hand-written file system. |
|
|
Nullean.Entities.CsCheck.Reactive
Rx scheduler scripts for Nullean.Entities.CsCheck: SampleWith, RunWith and SampleParallelWith drive a Script on a HistoricalScheduler and check Nullean.Entities.Reactive constraints. Opt-in; the default CsCheck package has no System.Reactive dependency. |
|
|
Nullean.Entities.CsCheck.AutoBogus
An AutoBogus-backed CsCheck generator for Nullean.Entities.CsCheck: plausible Bogus data for any type, reproducible by seed and shrinkable, for teams that already configure AutoFaker. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.1 | 63 | 10/20/2026 |
| 0.1.0 | 92 | 10/20/2026 |
| 0.1.0-preview.2 | 63 | 10/20/2026 |
| 0.1.0-preview.1 | 60 | 10/20/2026 |