affaan-m avatar

Fsharp Testing

This covers the full F# testing stack: xUnit for structure, FsUnit for idiomatic assertions, Unquote for quotation-based test failures that show you exactly what broke, and FsCheck for property-based testing. The examples are solid, from basic unit tests through async patterns, custom generators, and ASP.NET Core integration tests with WebApplicationFactory. The function stub approach for mocking is refreshingly practical compared to heavyweight mocking frameworks. Activate this when you're writing F# tests or setting up a test suite, especially if you want to move beyond basic assertions into property-based testing. The anti-patterns section alone is worth reading.

skills.sh installs
5.3K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --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/ecc
Categories
Testing & QA, .NET & C#
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263
1manaflow-ai avatarcmux-testingmanaflow-ai/cmuxcmux testing rules for Swift Testing, test target compilation, test wiring, and package/refactor validation. Use when adding or changing tests, touching package5.1Kskills.sh installs
2forcedotcom avatardx-devops-test-suite-assignments-configureforcedotcom/sf-skillsRecommends and manages DevOps Center test suite assignments for pipeline stages. Mode A analyzes a commit diff against assigned suite metadata to recommend rele5Kskills.sh installs
3composiohq avatarwebapp-testingcomposiohq/awesome-claude-skillsToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing br4.9Kskills.sh installs
4dotnet avatartest-gap-analysisdotnet/skillsPerforms pseudo-mutation analysis on production code in any language to find gaps in existing tests. Use when the user asks to find weak or shallow tests, disco4.3Kskills.sh installs
5mastra-ai avatare2e-tests-studiomastra-ai/mastraREQUIRED when modifying any file in packages/playground-ui or packages/playground. Triggers on: React component creation/modification/refactoring, UI changes, n2.5Kskills.sh installs
6owl-listener avataraccessibility-test-planowl-listener/designer-skillsCreate accessibility testing plans covering assistive technologies and WCAG criteria.2.3Kskills.sh installs