87. Introduction to Snapshot testing and using Verify.Xunit

Опубликовано: 23 Март 2026
на канале: Betabit
743
16

https://www.betabit.nl/en/betatalks

Michiel and Oscar discuss snapshot testing, which is a type of data comparison test. Snapshot testing saves the output of a test and compares it to the output on subsequent runs to detect any changes. Michiel demonstrates how to write snapshot tests using Verify.Xunit library in C#. They show how snapshot testing can detect unintended changes or bugs introduced when code is modified. Their demo uses a simple employee mapper to map personal data to employee data. Bugs are intentionally introduced to demonstrate how snapshot testing fails when the output changes unexpectedly.

Links for more information:
https://github.com/VerifyTests/Verify

Time stamps:
00:00 - Introduction and what is snapshot testing
02:05 - Simple demo setup
03:58 - Snapshot test code examples without Verify package
05:15 - Snapshot test code with Verify package
06:23 - Creating baseline comparison data by running test
09:00 - Introduce bug to demonstrate failure
13:28 - Extra settings for Verify package
17:21 - Closing remarks and outro

Join us on our Discord channel:   / discord  

There is more to come!

https://www.betabit.nl/en