nw-pbt-dotnet

Solid

.NET property-based testing with FsCheck, CsCheck, and fsharp-hedgehog frameworks

Testing & QA 526 stars 55 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
91
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# PBT .NET -- FsCheck + CsCheck (C#/F#) ## Framework Selection | Framework | Language | Shrinking | Stateful | Parallel | Choose When | |-----------|----------|-----------|----------|----------|-------------| | FsCheck | C#/F# | Type-based | No | No | F#-first projects, or C# needing mature PBT | | CsCheck | C# | PCG-based | Yes | Yes (linearizability) | C# projects needing concurrent testing | | fsharp-hedgehog | F# | Integrated | No | No | F# projects wanting modern integrated shrinking | **C# default**: CsCheck (better shrinking, stateful + parallel). **F# default**: FsCheck or fsharp-hedgehog. ## Quick Start (FsCheck) ```csharp // C# using FsCheck; using FsCheck.Xunit; public class SortProperties { [Property] public bool SortPreservesLength(List<int> xs) => xs.OrderBy(x => x).Count() == xs.Count; } ``` ```fsharp // F# open FsCheck let propSortIdempotent (xs: int list) = List.sort (List.sort xs) = List.sort xs Check.Quick propSortIdempotent ``` ## Generator Cheat Sheet (FsCheck) ### C# ```csharp Arb.Generate<int>() // any int Gen.Choose(0, 100) // bounded Arb.Generate<string>() Arb.Generate<List<int>>() // Custom generator public static Arbitrary<Email> EmailArb() => Arb.From( from name in Arb.Generate<NonEmptyString>() select new Email($"{name}@example.com") ); Arb.Register<MyGenerators>(); // register custom arbitraries ``` ### F# ```fsharp Gen.choose (0, 100) Gen.el...

Details

Author
nWave-ai
Repository
nWave-ai/nWave
Created
3 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category