nw-pbt-dotnet
Featured.NET property-based testing with FsCheck, CsCheck, and fsharp-hedgehog frameworks
Testing & QA 636 stars
68 forks Updated today MIT
Install
Quality Score: 98/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
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
- 9 months ago
- Last Updated
- today
- Language
- Python
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
Testing & QA Featured
nw-pbt-typescript
TypeScript/JavaScript property-based testing with fast-check framework and arbitraries
636 Updated today
nWave-ai Testing & QA Featured
nw-pbt-haskell
Haskell property-based testing with QuickCheck and Hedgehog frameworks
636 Updated today
nWave-ai Testing & QA Featured
nw-pbt-rust
Rust property-based testing with proptest, quickcheck, and bolero frameworks
636 Updated today
nWave-ai