Mutagen-Modding / Mutagen.Bethesda.Analyzers

A project to diagnose and analyze the health of a mod or a load order
GNU General Public License v3.0
18 stars 5 forks source link

IsolatedRecordTestFixture #146

Closed Noggog closed 1 month ago

Noggog commented 1 month ago

Added a IsolatedRecordTestFixture to help write tests for IsolatedRecordAnalyzers

The idea is you provide the criteria for the triggering scenario, criteria for making it no longer trigger, and then what topic(s) should be triggered. The system does the test, and eventually (hopefully) will test that the transition between the triggering scenario and non-triggering would provoke the engine to rerun (essentially testing the member accessor correctness)

I also cut up the monolith test classes into smaller ones organized by record type folder in preparation for other analyzer tests being put in the same folders/

Elscrux commented 1 month ago

First had to understand that MutagenModAutoData actually creates AssetLink attributes including existing in their name in the mock file system but I think the system in general is really elegant and should be easy to use. I can't quite say how well more complicated analyzers adapt to this but it's probably fine.