Replace Verify with in-house generator snapshot assertions
Merged
JA
4d ago+163+163+012345678901234567890123456789-85-85-01234567890123456789
Summary
Verify 33.x (pulled in by #149) adds a SponsorCheck build gate that fails the build (SC021) unless a sponsorship/licence MSBuild property is declared. Verify was only used by the 14 source generator snapshot tests, so this replaces it with a small in-house helper and drops the dependency.
- Add
GeneratorSnapshot, which compares each generated source against the existing{Class}.{Test}#{HintName}.verified.csfiles (unchanged), writes.received.cson mismatch, flags stale snapshots, and fails on generator diagnostics or exceptions - Exclude
*.verified.cs/*.received.csfrom compilation in both test projects (previously done by Verify's MSBuild targets) - Remove
Verify.NUnit/Verify.SourceGeneratorsand theVerify*Dependabot group pattern - Fix
NativeCodecsTests.Initialize_WithEnableOptions_SetsProperties: enable options are applied before the native library is probed, so the library-unavailable branch asserted the wrong values (only reproducible where the native library is absent)
Testing
- Solution builds with 0 warnings / 0 errors
- Full test suite passes on net10.0 locally
- Confirmed a deliberately altered snapshot fails with a clear message and writes a
.received.csfile
After this merges, #149 only needs the NUnit 5 API fixes.
Summary by cubic
Verify 33.x adds a SponsorCheck build gate that fails the build unless a sponsorship MSBuild property is declared. Verify was only used for the 14 source generator snapshot tests, so this replaces it with a small in-house helper and drops the dependency.
- Adds
GeneratorSnapshot, which compares each generated source against the existing{Class}.{Test}#{HintName}.verified.csfiles, writes.received.cson mismatch, flags stale snapshots, and fails on generator diagnostics or exceptions. - Excludes
*.verified.csand*.received.csfrom compilation in both test projects (previously handled by Verify's MSBuild targets). - Removes
Verify.NUnit,Verify.SourceGenerators, and theVerify*Dependabot pattern. - Fixes
NativeCodecsTests.Initialize_WithEnableOptions_SetsProperties: enable options are applied before the native library is probed, so the library-unavailable branch was asserting the wrong values. - Maps CI-recorded
/ _/source paths back to the repository root, measured via aRepositoryRootassembly metadata item, so snapshot files resolve in deterministic builds.