FsCheck.Xunit
3.6.0
dotnet add package FsCheck.Xunit --version 3.6.0
NuGet\Install-Package FsCheck.Xunit -Version 3.6.0
<PackageReference Include="FsCheck.Xunit" Version="3.6.0" />
<PackageVersion Include="FsCheck.Xunit" Version="3.6.0" />
<PackageReference Include="FsCheck.Xunit" />
paket add FsCheck.Xunit --version 3.6.0
#r "nuget: FsCheck.Xunit, 3.6.0"
#:package FsCheck.Xunit@3.6.0
#addin nuget:?package=FsCheck.Xunit&version=3.6.0
#tool nuget:?package=FsCheck.Xunit&version=3.6.0
FsCheck.Xunit
FsCheck.Xunit integrates FsCheck with xUnit.NET by adding a PropertyAttribute that runs FsCheck tests, similar to xUnit.NET's FactAttribute.
Quick Start
Install via NuGet:
dotnet add package FsCheck.Xunit
Define a test class with FsCheck properties:
open Xunit
open FsCheck
open FsCheck.Xunit
type ListProperties =
[<Property>]
member _.``Reverse of reverse is identity`` (xs:list<int>) =
List.rev(List.rev xs) = xs
[<Property>]
member _.``List length unchanged after reverse`` (xs:list<int>) =
List.length (List.rev xs) = List.length xs
Or in C#:
using Xunit;
using FsCheck;
using FsCheck.Xunit;
public class ListProperties
{
[Property]
public void ReverseOfReverseIsIdentity(int[] xs)
{
Assert.Equal(xs, xs.Reverse().Reverse());
}
}
Features
- PropertyAttribute for easy integration with xUnit.NET test discovery
- Automatic test case generation using FsCheck
- Full configuration support via attribute parameters
- Shrinking for minimal counter-examples
Configuration
Configure FsCheck via the PropertyAttribute:
[<Property(MaxTest = 10000, StartSize = 100, EndSize = 1000)>]
member _.``Custom configuration`` (xs:list<int>) = true
Documentation
For comprehensive documentation, visit https://fscheck.github.io/FsCheck/
License
FsCheck.Xunit is licensed under the BSD 3-Clause license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- FsCheck (= 3.6.0)
- FSharp.Core (>= 5.0.2)
- xunit.extensibility.execution (>= 2.4.1 && < 3.0.0)
-
.NETStandard 2.0
- FsCheck (= 3.6.0)
- FSharp.Core (>= 5.0.2)
- xunit.extensibility.execution (>= 2.4.1 && < 3.0.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on FsCheck.Xunit:
| Package | Downloads |
|---|---|
|
Wolfgang.AuditTrail.TestKit.Xunit
Shipped xunit contract-test bases for the Wolfgang.AuditTrail family. AuditValueSerializerContractTests<TSut> uses FsCheck.Xunit property-based testing plus explicit boundary theories to verify any IAuditValueSerializer implementation round-trips every supported CLR type. Each new serializer (binary, hybrid, custom) inherits the suite and provides CreateSut(). |
|
|
DitzyExtensions.Testing
a collection of extensions and utilities for writing fluent and property based unit tests. |
|
|
Conformist
A comprehensive C# library for property-based testing of WebAPI endpoints for HTTP RFC compliance. Automatically discovers API endpoints and validates them against HTTP RFC standards including safety, idempotency, and response consistency properties. |
|
|
WotR.Testing
Test tooling for Pathfinder: Wrath of the Righteous mods. Offline tests run against the real game assemblies on Unity Mono without starting the game. Interface fuzzing automatically generates method calls and arguments, shrinks failures and replays saved cases. Game files come from your own installation and are never part of the packages. |
GitHub repositories (28)
Showing the top 20 popular GitHub repositories that depend on FsCheck.Xunit:
| Repository | Stars |
|---|---|
|
dotnet/runtime
.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
|
|
|
App-vNext/Polly
Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. From version 6.0.1, Polly targets .NET Standard 1.1 and 2.0+.
|
|
|
coding-horror/basic-computer-games
An updated version of the classic "Basic Computer Games" book, with well-written examples in a variety of common MEMORY SAFE, SCRIPTING programming languages. See https://coding-horror.github.io/basic-computer-games/
|
|
|
akkadotnet/akka.net
Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
|
|
|
open-telemetry/opentelemetry-dotnet
The OpenTelemetry .NET Client
|
|
|
oskardudycz/EventSourcing.NetCore
Examples and Tutorials of Event Sourcing in .NET
|
|
|
AIDotNet/OpenDeepWiki
OpenDeepWiki is the open-source version of the DeepWiki project, aiming to provide a powerful knowledge management and collaboration platform. The project is mainly developed using C# and TypeScript, supporting modular design, and is easy to expand and customize.
|
|
|
opentk/opentk
The Open Toolkit library is a fast, low-level C# wrapper for OpenGL, OpenAL & OpenCL. It also includes windowing, mouse, keyboard and joystick input and a robust and fast math library, giving you everything you need to write your own renderer or game engine. OpenTK can be used standalone or inside a GUI on Windows, Linux, Mac.
|
|
|
microsoft/onefuzz
A self-hosted Fuzzing-As-A-Service platform
|
|
|
RankFTW/RHI
ReShade HDR Installer
|
|
|
FakeFishGames/Barotrauma
A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
|
|
|
NeutroniumCore/Neutronium
🚀 Build .NET desktop applications using HTML, CSS and javascript.
|
|
|
dotnet/dotnet
Home of .NET's Virtual Monolithic Repository which includes all the code needed to build the .NET SDK.
|
|
|
wabbajack-tools/wabbajack
An automated Modlist installer for various games.
|
|
|
open-telemetry/opentelemetry-dotnet-contrib
This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
|
|
|
la-yumba/functional-csharp-code
Code samples for Functional Programming in C#
|
|
|
DavidObando/gsharp
GSharp Programming Language
|
|
|
helios-io/helios
reactive socket middleware for .NET
|
|
|
VSadov/Satori
Experimenting with dotnet runtime.
|
|
|
Delta3-Studio/Backdash
C# Rollback network SDK
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.6.0 | 4,158 | 10/21/2026 |
| 3.5.0 | 12,494 | 10/17/2026 |
| 3.4.0 | 294,941 | 8/20/2026 |
| 3.3.4 | 136,491 | 7/25/2026 |
| 3.3.3 | 537,338 | 4/26/2026 |
| 3.3.2 | 581,757 | 11/9/2025 |
| 3.3.1 | 96,394 | 8/24/2025 |
| 3.3.0 | 213,517 | 6/3/2025 |
| 3.2.0 | 87,411 | 4/10/2025 |
| 3.1.0 | 338,169 | 1/30/2025 |
| 3.0.1 | 24,849 | 1/22/2025 |
| 3.0.0 | 350,722 | 1/7/2025 |
| 3.0.0-rc3 | 124,481 | 3/3/2024 |
| 3.0.0-rc2 | 1,059 | 2/25/2024 |
| 3.0.0-rc1 | 46,795 | 7/23/2023 |
| 3.0.0-beta2 | 83,733 | 1/8/2022 |
| 3.0.0-beta1 | 12,818 | 9/5/2021 |
| 2.16.6 | 1,632,135 | 7/1/2023 |
| 2.16.5 | 805,217 | 6/1/2022 |
| 2.16.4 | 436,255 | 1/8/2022 |
Additionally target netstandard2.1 and net8.0.
Added generators and shrinkers for `System.Index` and `System.Range` (#621), `Memory<T>`, `ReadOnlyMemory<T>`, `ReadOnlySequence<T>`, `ValueTask` and `ValueTask<T>` in netstandard2.1.
Added generators and shrinkers for `System.Half`, `Int128`, `UInt128`, `DateOnly`, `TimeOnly` and `Rune` in net8.0.
Added `NullableRef<T>` to conveniently generate nulls for reference types (#610).