using AcDream.Core.Physics; using DatReaderWriter.Enums; using System.Collections.Generic; using System.Numerics; using Xunit; namespace AcDream.Core.Tests.Physics; /// /// Tests for the ISSUES #83 H-disambiguation probe spike (spec /// 2026-05-21-indoor-walk-miss-probe-design.md). /// /// Covers: /// 1. PhysicsDiagnostics.ProbeWalkMissEnabled flag get/set roundtrip. /// 2. WalkMissDiagnostic.AggregateNearestWalkable selects the nearest /// walkable polygon by |dz| when the foot XY lies inside a poly's /// local XY bounding box. /// 3. WalkMissDiagnostic.AggregateNearestWalkable falls back to the /// nearest poly by |dz| when no walkable poly XY-contains the foot, /// reporting ContainsFootXY=false. /// public class WalkMissDiagnosticTests { [Fact] public void ProbeWalkMiss_StaticApi_Roundtrip() { bool initial = PhysicsDiagnostics.ProbeWalkMissEnabled; try { PhysicsDiagnostics.ProbeWalkMissEnabled = true; Assert.True(PhysicsDiagnostics.ProbeWalkMissEnabled); PhysicsDiagnostics.ProbeWalkMissEnabled = false; Assert.False(PhysicsDiagnostics.ProbeWalkMissEnabled); } finally { PhysicsDiagnostics.ProbeWalkMissEnabled = initial; } } }