test: cover mission validator contracts - #932
Conversation
marceld23
left a comment
There was a problem hiding this comment.
Checked every assertion against MissionValidator.cs and ran locally: 9/9 passing in ~1 s, Release, no warnings; CI green. There was no source-level test coverage for the validator before — good pick, since both the in-game player editor and the admin extension editor share these rules.
All seven problem-message assertions match the implementation verbatim, the Mine-resolves-blocks vs. everything-else-resolves-items branch is exercised from both sides, and the happy path pins Validate returning empty AND IsValid. The per-test Load() helper mirrors what ContentTests and the worldgen tests already do, so it fits the house style.
One recurring micro-nit (third PR in a row, so worth mentioning once): a blank line is missing between a closing method brace and the next [Fact] (here after Validate_AcceptsKnownGoodMission). dotnet format doesn't enforce it, so nothing fails — just a readability habit worth adopting. Merging.
Relates to #571
Adds focused unit tests for the documented MissionValidator contracts: