This walks you through Verify, the .NET snapshot testing library that's genuinely useful for catching regressions in rendered output. Instead of writing a dozen assertions for complex objects, you approve a baseline file once and the test fails if anything changes. The guide covers the practical stuff: rendering email templates to HTML and diffing them visually, approving your public API surface to prevent accidental breaking changes, scrubbing timestamps and GUIDs so tests aren't flaky, and setting up CI so you're not manually clicking through diff tools in your pipeline. If you're testing anything with non-trivial output like HTTP responses or serialized data, this is worth the setup cost.

skills.sh installs
484
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add aaronontheweb/dotnet-skills --skill snapshot-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

Snapshot Testing with Verify

When to Use This Skill

Use snapshot testing when:

  • Verifying rendered output (HTML emails, reports, generated code)
  • Approving public API surfaces for breaking change detection
  • Testing HTTP response bodies and headers
  • Validating serialization output
  • Catching unintended changes in complex objects

What is Snapshot Testing?

Snapshot testing captures output and compares it against a human-approved baseline:

  1. First run: Test generates a .received. file with actual output
  2. Human review: Developer approves it, creating a .verified. file
  3. Subsequent runs: Test compares output against .verified. file
  4. Changes detected: Test fails, diff tool shows differences for review

This catches unintended changes while allowing intentional changes through explicit approval.


Installation

Add Verify Package

dotnet add package Verify.Xunit
# or for other test frameworks:
dotnet add package Verify.NUnit
dotnet add package Verify.MSTest

Configure ModuleInitializer

Create a ModuleInitializer.cs in your test project:

using System.Runtime.CompilerServices;

Sponsors

Details

Repository
github.com/aaronontheweb/dotnet-skills
Categories
Backend & APIs, Testing & QA, .NET & C#
First seen
Jun 3, 2026

More from aaronontheweb/dotnet-skills

All 34
1gocallum avatarai-sdk-6-skillsgocallum/nextjs16-agent-skillsAI SDK 6 Beta overview, agents, tool approval, Groq (Llama), and Vercel AI Gateway. Key breaking changes from v5 and new patterns.484skills.sh installs
2hqman avatarqverishqman/qverisSearch and execute dynamic tools via QVeris API. Use when needing to find and call external APIs/tools dynamically (weather, search, data retrieval, stock tradi484skills.sh installs
3alirezarezvani avatarship-gatealirezarezvani/claude-skillsPre-production audit that scans a codebase for security, database, deployment, code quality, AI/LLM, dependency, frontend, and observability issues. Intercepts 483skills.sh installs
4agricidaniel avatarcanvasagricidaniel/claude-obsidianCreate, inspect, and update Obsidian JSON Canvas boards with text, file, link, group, and edge nodes. Use for canvas status, canvas lists, visual maps, zones, s479skills.sh installs
5freestylefly avatarobsidian-basesfreestylefly/canghe-skillsCreate and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of no477skills.sh installs
6shadowcz007 avatarqq-emailshadowcz007/skills面向 QQ 邮箱的 IMAP 收邮件、SMTP 发邮件;账号与授权码从环境变量 QQ_EMAIL_ACCOUNT、QQ_EMAIL_AUTH_CODE 读取。在用户要发 QQ 邮件、收邮件、查邮件、代发邮件或配置 QQ 邮箱时使用。477skills.sh installs