This covers the full F# testing stack: xUnit for structure, FsUnit for F# friendly assertions, Unquote for quotation based failure messages that actually tell you what broke, and FsCheck for property based testing. You get working examples of async tests with task, parameterized theories, custom generators, and both function stub patterns (the F# way) and NSubstitute for .NET interfaces. The integration testing section shows WebApplicationFactory setup with in-memory databases. Use this when you're setting up a new F# project's test suite or when your existing tests feel clunky because you're fighting against C# patterns. The anti-patterns section alone is worth reading if you've been writing Thread.Sleep in your async tests.

skills.sh installs
1.6K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill fsharp-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

F# Testing Patterns

Comprehensive testing patterns for F# applications using xUnit, FsUnit, Unquote, FsCheck, and modern .NET testing practices.

When to Activate

  • Writing new tests for F# code
  • Reviewing test quality and coverage
  • Setting up test infrastructure for F# projects
  • Debugging flaky or slow tests

Test Framework Stack

ToolPurpose
xUnitTest framework (standard .NET ecosystem choice)
FsUnit.xUnitF#-friendly assertion syntax for xUnit
UnquoteAssertion library using F# quotations for clear failure messages
FsCheck.xUnitProperty-based testing integrated with xUnit
NSubstituteMocking .NET dependencies
TestcontainersReal infrastructure in integration tests
WebApplicationFactoryASP.NET Core integration tests

Unit Tests with xUnit + FsUnit

Basic Test Structure

module OrderServiceTests

open Xunit
open FsUnit.Xunit

[<Fact>]
let ``create sets status to Pending`` () =
    let order = Order.create "cust-1" [ validItem ]
    order.Status |> should equal Pending

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Categories
Testing & QA, .NET & C#
First seen
Jun 3, 2026

More from affaan-m/everything-claude-code

All 256
1affaan-m avatarquarkus-tddaffaan-m/everything-claude-codequarkus tdd1.6Kskills.sh installs
2forcedotcom avatargenerating-apex-testforcedotcom/afv-librarygenerating apex test1.6Kskills.sh installs
3jaganpro avatarsf-testingjaganpro/sf-skillssf testing1.4Kskills.sh installs
4lobehub avatartestinglobehub/lobe-chattesting1.3Kskills.sh installs
5neolabhq avatartest-skillneolabhq/context-engineering-kitUse when creating or editing skills, before deployment, to verify they work under pressure and resist rationalization - applies RED-GREEN-REFACTOR cycle to proc1.2Kskills.sh installs
6ruvnet avataragent-tdd-london-swarmruvnet/rufloAgent skill for tdd-london-swarm - invoke with $agent-tdd-london-swarm1.1Kskills.sh installs