Verify is a .NET snapshot-testing library that compares test output with an approved version and fails when the output changes. It makes important SQL changes visible during code review without pretending to prevent every database problem. section 9.4.1
A practical SQL verification workflow:
- Capture Entity Framework Core SQL through a database interceptor and write the commands to test output or a stream. section 9.4.1
- Use Verify or Verify.EntityFramework to compare the captured SQL with its accepted version. section 9.4.1
- Review intentional differences when a LINQ or schema change produces different SQL. section 9.4.1
Detecting an unintended query change
A test records the SQL generated for catalog operations. Verify compares that recording with the approved result; a changed query fails the test and requires the change author and reviewers to acknowledge it. section 9.4.1
