

Mastering Dotnet Testing: Using Verify to Minimize Assertions - .NET 192
8 snips Jul 2, 2024
Simon Cropp, an expert in snapshot testing and the tool Verify, joins the conversation to delve into the intricacies of .NET testing. He discusses how snapshot testing simplifies verification of serialized states and reduces test code significantly. The chat highlights Verify's flexibility for managing ordered and unordered collections, as well as its seamless handling of random data. Listeners can also catch tips on advanced snapshot management and hear about intriguing tech recommendations, including the upcoming Star Wars series, 'The Acolyte.'
AI Snips
Chapters
Transcript
Episode notes
Snapshot Testing Explained
- Snapshot testing (or serialization assertion) serializes test data and saves it to disk.
- Subsequent test runs compare new data to the saved snapshot, simplifying assertions.
Simplify Assertions
- Replace many assertions by running the verify method on objects under test.
- This serializes the object and compares it to a saved snapshot.
Verify's Flexibility
- Verify works with various data, including objects, properties, and anonymous objects.
- Some caveats exist for data that is not easily serialized or compared.