FsCheck.Xunit.v3
3.4.0
dotnet add package FsCheck.Xunit.v3 --version 3.4.0
NuGet\Install-Package FsCheck.Xunit.v3 -Version 3.4.0
<PackageReference Include="FsCheck.Xunit.v3" Version="3.4.0" />
<PackageVersion Include="FsCheck.Xunit.v3" Version="3.4.0" />
<PackageReference Include="FsCheck.Xunit.v3" />
paket add FsCheck.Xunit.v3 --version 3.4.0
#r "nuget: FsCheck.Xunit.v3, 3.4.0"
#:package FsCheck.Xunit.v3@3.4.0
#addin nuget:?package=FsCheck.Xunit.v3&version=3.4.0
#tool nuget:?package=FsCheck.Xunit.v3&version=3.4.0
FsCheck.Xunit.v3
FsCheck.Xunit integrates FsCheck with xUnit.NET v3 by adding a PropertyAttribute that runs FsCheck tests, similar to xUnit.NET's FactAttribute.
Quick Start
Install via NuGet:
dotnet add package FsCheck.Xunit.v3
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.v3 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 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. |
-
.NETStandard 2.0
- FsCheck (= 3.4.0)
- FSharp.Core (>= 5.0.2)
- xunit.v3.extensibility.core (>= 4.0.0 && < 5.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FsCheck.Xunit.v3:
| Package | Downloads |
|---|---|
|
Xunit.DependencyInjection.FsCheck
Support Xunit.SkippableFact. public void ConfigureServices(IServiceCollection services) { services.AddFsCheckSupport(); } Not support: 1. ITestOutputHelperAccessor.Output is alway null. so, ILogger can't output to xunit output. 2. Can't inject ITestOutputHelper 3. [MethodData] |
GitHub repositories (7)
Showing the top 7 popular GitHub repositories that depend on FsCheck.Xunit.v3:
| Repository | Stars |
|---|---|
|
jellyfin/jellyfin
The Free Software Media System - Server Backend & API
|
|
|
akkadotnet/akka.net
Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
|
|
|
TolikPylypchuk/SharpHook
SharpHook provides a cross-platform global keyboard and mouse hook, event simulation, and text entry simulation for .NET
|
|
|
exercism/csharp
Exercism exercises in C#.
|
|
|
jellyfin/TMDbLib
C#.Net library for TheMovieDB
|
|
|
martincostello/sqllocaldb
SQL LocalDB Wrapper is a .NET library providing interop with the Microsoft SQL Server LocalDB Instance API
|
|
|
ForNeVeR/TruePath
File path abstraction library for .NET.
|
Updated xunit.v3 to version 4.x. (by Simon Baynes)