FsCheck 3.0.0-beta1

This is a prerelease version of FsCheck.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package FsCheck --version 3.0.0-beta1
NuGet\Install-Package FsCheck -Version 3.0.0-beta1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FsCheck" Version="3.0.0-beta1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FsCheck --version 3.0.0-beta1
#r "nuget: FsCheck, 3.0.0-beta1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FsCheck as a Cake Addin
#addin nuget:?package=FsCheck&version=3.0.0-beta1&prerelease

// Install FsCheck as a Cake Tool
#tool nuget:?package=FsCheck&version=3.0.0-beta1&prerelease

FsCheck is a tool for testing .NET programs automatically. You provide a specification of the program, in the form of properties which functions, methods or objects should satisfy, and FsCheck then tests that the properties hold in a large number of randomly generated cases. Such properties are actually a testable specification of your program.

Properties are written in F#, C# or VB. FsCheck helps you to define properties, observe the distribution of test data, and define test data generators. Crucially, when a property fails, FsCheck automatically displays a minimal counter example.

Product 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. 
.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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (25)

Showing the top 5 NuGet packages that depend on FsCheck:

Package Downloads
FsCheck.Xunit

FsCheck.Xunit integrates FsCheck with xUnit.NET by adding a PropertyAttribute that runs FsCheck tests, similar to xUnit.NET's FactAttribute. All the options normally available in vanilla FsCheck via configuration can be controlled via the PropertyAttribute.

FsCheck.NUnit

FsCheck.NUnit integrates FsCheck with NUnit by adding a PropertyAttribute that runs FsCheck tests, similar to NUnit TestAttribute. All the options normally available in vanilla FsCheck via configuration can be controlled via the PropertyAttribute.

Expecto.FsCheck The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Property testing for Expecto, powered by FsCheck

AutoFixture.Idioms.FsCheck The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Ubiquitous use of AutoFixture for unit testing has given rise to a number of idiomatic unit tests - unit tests that tend to follow common templates. The AutoFixture Idioms.FsCheck library encapsulates these idioms into reusable classes and methods.

MBrace.Tests

A collection of abstract NUnit-based test suites for evaluating MBrace runtime implementations.

GitHub repositories (17)

Showing the top 5 popular GitHub repositories that depend on FsCheck:

Repository Stars
dotnet/runtime
.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
akkadotnet/akka.net
Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
commandlineparser/commandline
The best C# command line parser that brings standardized *nix getopt style, for .NET. Includes F# support
AutoFixture/AutoFixture
AutoFixture is an open source library for .NET designed to minimize the 'Arrange' phase of your unit tests in order to maximize maintainability. Its primary goal is to allow developers to focus on what is being tested rather than how to setup the test scenario, by making it easier to create object graphs containing test data.
microsoft/onefuzz
A self-hosted Fuzzing-As-A-Service platform
Version Downloads Last updated
3.0.0-rc3 6,630 3/3/2024
3.0.0-rc2 1,277 2/25/2024
3.0.0-rc1 38,730 7/23/2023
3.0.0-beta2 72,637 1/8/2022
3.0.0-beta1 12,282 9/5/2021
3.0.0-alpha5 45,920 12/28/2020
3.0.0-alpha4 321,688 10/6/2018
3.0.0-alpha3 99,140 12/30/2017
3.0.0-alpha2 8,752 10/19/2017
3.0.0-alpha1 4,667 9/26/2017
2.16.6 431,822 7/1/2023
2.16.5 839,561 6/1/2022
2.16.4 543,269 1/8/2022
2.16.3 277,354 9/4/2021
2.16.2 8,608 8/30/2021
2.16.0 53,711 8/13/2021
2.15.3 245,034 5/8/2021
2.15.2 91,587 4/15/2021
2.15.1 144,323 2/27/2021
2.15.0 27,885 2/23/2021
2.14.6 51,611 2/21/2021
2.14.5 5,157 2/18/2021
2.14.4 34,000 1/31/2021
2.14.3 567,406 6/9/2020
2.14.2 182,702 3/11/2020
2.14.0 913,831 4/17/2019
2.13.0 310,304 11/11/2018
2.12.1 33,224 10/18/2018
2.12.0 12,241 10/6/2018
2.11.0 256,750 6/15/2018
2.10.10 72,252 5/15/2018
2.10.9 412,688 4/10/2018
2.10.8 79,220 3/3/2018
2.10.7 23,076 1/29/2018
2.10.6 23,899 12/30/2017
2.10.5 18,342 12/28/2017
2.10.4 94,321 11/8/2017
2.10.3 13,058 9/26/2017
2.10.2 12,412 9/25/2017
2.10.1 4,521 9/23/2017
2.10.0 17,105 9/7/2017
2.9.2 11,592 8/28/2017
2.9.1 4,084 8/27/2017
2.9.0 176,344 5/18/2017
2.9.0-rc3 6,325 5/7/2017
2.9.0-rc2 2,355 5/6/2017
2.9.0-rc1 2,341 5/6/2017
2.8.2 11,087 5/6/2017
2.8.1 4,115 5/1/2017
2.8.0 21,406 3/15/2017
2.7.2 11,635 3/5/2017
2.7.1 17,463 2/13/2017
2.7.0 13,678 1/15/2017
2.6.3 6,187 1/13/2017
2.6.2 104,039 10/7/2016
2.6.1 57,286 9/25/2016
2.6.0 43,232 8/3/2016
2.5.0 79,535 6/7/2016
2.4.0 18,378 4/20/2016
2.3.0 6,385 4/11/2016
2.2.5 6,841 3/28/2016
2.2.4 27,341 12/17/2015
2.2.3 6,430 11/26/2015
2.2.2 6,681 11/14/2015
2.2.1 4,729 11/5/2015
2.2.0 20,804 11/1/2015
2.1.0 12,816 9/30/2015
2.0.7 15,636 8/20/2015
2.0.6 5,197 8/14/2015
2.0.5 21,823 7/31/2015
2.0.4 10,076 7/20/2015
2.0.3 31,532 7/10/2015
2.0.2 3,798 7/7/2015
2.0.1 25,290 5/23/2015
2.0.1-rc1 2,327 5/23/2015
2.0.0-alpha 2,662 4/27/2015
1.0.4 22,899 12/9/2014
1.0.3 5,714 11/18/2014
1.0.2 4,653 10/27/2014
1.0.1 5,155 10/18/2014
1.0.0 11,893 8/3/2014
0.9.4 45,794 5/24/2014
0.9.3 3,367 5/9/2014
0.9.2 62,993 11/7/2013
0.9.1 6,030 7/2/2013
0.9.0.1 3,226 6/21/2013
0.9.0 3,365 6/18/2013
0.8.3 4,625 8/26/2012
0.8.2 3,393 7/4/2012
0.8.1 3,743 6/25/2012
0.7.1 7,242 5/29/2011

Backwards incompatible*: Refactor and split of the `Gen` and `Arbitrary` APIs into `FsCheck.FSharp` and `FsCheck.Fluent`. This is a first step in splitting the entire API into a functional (for F# consumers) and fluent (for C# and VB.NET consumers) interface. This should be clearer for both kinds of consumers.
By and large, if you are an F# user, now `open FsCheck.FSharp` in addition to `open FsCheck`. If you are a C# or VB.NET user, add `using FsCheck.Fluent`.
Backwards incompatible*: redesigned API for per-type Arbitrary instance discovery and lookup. There is no longer a single global, mutable map of type to Arbitrary instances, instead there are any number of immutable `IArbMap`s that can be configured at your leisure, and set via `Config.WithArbitrary` on the test.
Detailed changes to `FsCheck.FSharp.Gen`: Added `RequireQualifiedAccess`. Added `apply` and `bind`. Renamed `collect` and `sequence` to `collect/sequenceToList/Array/Seq` for clarity. Removed `unzip` and `unzip3` - their implementation is problematic, and it's hard to see a use case for them. Removed `subListOfToIlist`, `subListOfArr` - these returned `IList&lt;'T&gt;` types. Untupled `rows,cols` arguments in `array2DOfDim`.
Detailed changes to `FsCheck.Fluent.Gen`: Split into non-extension methods on `Gen` and extension methods on `Gen&lt;T&gt;` type in `GenExtensions`. Removed `Gen.Apply` - not useful without partial application. `Two`, `Three`, `Four` and `Zip` now output ValueTuples, which is idiomatic in modern C#, and are only visible as extension methods on `Gen&lt;T&gt;`. Removed the overloads of `Zip` with arity 3. Changed the return type of methods that returned `IList&lt;T&gt;` previously to `List&lt;T&gt;`. Split the `Sample` method with optional arguments in three overloads, this is better for backwards compatibilty going forward.
Detailed changes to `FsCheck.FSharp.Arb`: Removed `fromGenShrinkFunc`. Removed `register`, `registerByType`, `from`, `generate` and `shrink` - these are replaced by functions on `ArbMap`, resp. `mergeWith`, `mergeWithType`, `arbitrary` and `generate`. Made `Arb.Default` internal. Default types should now be looked up using `ArbMap`, e.g. `ArbMap.defaults |&gt; ArbMap.arbitrary&lt;list&lt;int&gt;&gt;`.
Detailed changes to `FsCheck.Fluent.Arb`: Removed extension method `ToArbitrary` that took an F# function as argument for the shrinker. Renamad `Arb.From` methods to `Arbitrary.From` - C# does not tolerate ambiguity between using two types of the same name in the same namespace. Removed `Register`, `RegisterByType`, `From`, `Generate` and `Shrink` - these are replaced by methods on `ArbMap`, resp. `Merge&lt;'T&gt;`, `Merge`, `ArbFor` and `GeneratorFor`. Made `Arb.Default` internal. Default Arbitrary types should now be looked up using `ArbMap`, e.g. `ArbMap.Default.ArbFor&lt;int[]&gt;()`.
First pass at improving XML docs for Gen API.
Fixed bug in `try..with` computation expression builder.
Added support for `let!...and!...` syntax in computation expression builder.