SKILL

fsharp-testing

F# 测试模式,包括 xUnit、FsUnit、Unquote、FsCheck 属性测试、集成测试和测试组织最佳实践。适用于使用 xUnit、FsUnit、Unquote 或 FsCheck 编写 F# 测试。

译文已校对
查看英文原文

F# testing patterns with xUnit, FsUnit, Unquote, FsCheck property-based testing, integration tests, and test organization best practices. Use when writing F# tests with xUnit, FsUnit, Unquote, or FsCheck.

适用对象:软件开发与测试。自动收录 · 待核查。

原作者说明节选

从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。

查看英文原文

原文涵盖的主题

  • F# Testing Patterns
  • When to Activate
  • Test Framework Stack
  • Unit Tests with xUnit + FsUnit
  • Basic Test Structure
  • Assertions with Unquote
  • Async Tests
  • Parameterized Tests with Theory

Comprehensive testing patterns for F# applications using xUnit, FsUnit, Unquote, FsCheck, and modern .NET testing practices. Writing new tests for F# code Reviewing test quality and coverage Setting up test infrastructure for F# projects Debugging flaky or slow tests | Tool | Purpose | |---|---| | xUnit | Test framework (standard .NET ecosystem choice) | | FsUnit.xUnit | F#-friendly assertion syntax for xUnit | | Unquote | Assertion library using F# quotations for clear failure messages | | FsCheck.xUnit | Property-based testing integrated with xUnit | | NSubstitute | Mocking .NET dependencies | | Testcontainers | Real infrastructure in integration tests | | WebApplicationFactory | ASP.NET Core integration tests | Unquote uses F# quotations so failure messages show the full expression that failed, not just "expected X got Y". | Anti-Pattern | Fix | |---|---| | Testing implementation details | Test behavior and outcomes | | Mutable shared test state | Fresh state per test | | Thread.Sleep in async tests | Use Task.Delay with timeout, or polling helpers | | Asserting on sprintf output | Assert on typed values and pattern matches | | Ignoring CancellationToken | Always pass and verify

这里只展示节选,请以完整原文和当前要求为准。

来源仓库
affaan-m/ECC
源文件
pi/core/skills/fsharp-testing/SKILL.md
固定版本
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
阅读完整原作者说明 ↗

来源与内容状态

本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。

原作者:affaan-m/ECC · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T15:01:43.025Z。

分类由名称、说明与路径规则生成,分类不代表已核实适配。

许可与权利归属

MIT。第三方内容及版权归原作者,使用条件以原文为准。

许可原文 ↗

本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。

限制与注意事项

  • 元数据收录不代表本站已经安装、适配、实测或进行安全审查。