snapshot-testing

Validate .NET test outputs against approved Verify snapshot baselines.

1.1k|101|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill snapshot-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: snapshot-testing
Source: https://github.com/Aaronontheweb/dotnet-skills/tree/main/skills/snapshot-testing
Command: npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill snapshot-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps .NET developers validate outputs by capturing snapshots and verifying them against approved baselines, reducing manual review and preventing regressions in UI, API responses, and serialized data.

Core Features & Use Cases

  • Snapshot creation & verification: Generate .received files during tests and compare them to .verified baselines.
  • Framework compatibility: Works with Verify.Xunit, Verify.NUnit, and Verify.MSTest to fit common .NET testing stacks.
  • CI-friendly: Integrates with CI to fail on unapproved changes and stream diffs for quick review.
  • Use Case: Validate that a rendered email template remains visually and structurally consistent across code changes.

Quick Start

  1. Add Verify packages to your test project (e.g., Verify.Xunit, Verify.NUnit, or Verify.MSTest).
  2. Configure a ModuleInitializer to set up project-relative snapshot directories and scrub dynamic values as needed.
  3. Run tests to generate .received files, review diffs, and commit the resulting .verified files to source control.

Frequently Asked Questions about snapshot-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up snapshot testing for a .NET test project?

Snapshot testing in .NET requires adding Verify packages to your test project, configuring a ModuleInitializer for snapshot storage, and running tests to generate .received and .verified baseline files.

What is the best way to validate API responses against a baseline in xUnit?

Validating API responses against a baseline in xUnit involves using Verify.Xunit to capture output into a .received file and compare it against an approved .verified baseline file.

Does snapshot testing work with NUnit and MSTest frameworks?

Yes, snapshot testing works with NUnit and MSTest through dedicated compatibility packages like Verify.NUnit and Verify.MSTest, integrating baseline verification into your existing .NET testing stack.

How do I handle dynamic values when verifying snapshots in CI workflows?

Handling dynamic values when verifying snapshots in CI workflows involves configuring scrubbing routines in your ModuleInitializer to strip volatile data before comparing .received files to approved baselines.

Can I use snapshot testing to check rendered UI and email templates for regressions?

You can use snapshot testing to check rendered UI and email templates for regressions by capturing serialized output and validating it against approved baselines to prevent visual and structural changes.

Why do my snapshot tests fail in CI after generating baseline files?

Snapshot tests fail in CI when code changes produce unapproved diffs between .received and .verified files; you must review the streamed diffs, approve the changes, and commit the updated baselines.

Related Skills