using AcDream.Core.Rendering; using Xunit; namespace AcDream.Core.Tests.Rendering; public class CameraDiagnosticsTests { // NOTE: These tests assume the env vars ACDREAM_RETAIL_CHASE and // ACDREAM_CAMERA_ALIGN_SLOPE are NOT set when running the test // suite. Static class is initialised on first access; values reflect // the env state at that time. [Fact] public void Defaults_AreRetailValues() { // Reset to defaults explicitly (test isolation; another test may // have flipped these earlier in the run). CameraDiagnostics.TranslationStiffness = 0.45f; CameraDiagnostics.RotationStiffness = 0.45f; CameraDiagnostics.MouseLowPassWindowSec = 0.25f; CameraDiagnostics.CameraAdjustmentSpeed = 40.0f; CameraDiagnostics.AlignToSlope = true; CameraDiagnostics.UseRetailChaseCamera = true; Assert.Equal(0.45f, CameraDiagnostics.TranslationStiffness); Assert.Equal(0.45f, CameraDiagnostics.RotationStiffness); Assert.Equal(0.25f, CameraDiagnostics.MouseLowPassWindowSec); Assert.Equal(40.0f, CameraDiagnostics.CameraAdjustmentSpeed); Assert.True(CameraDiagnostics.AlignToSlope); // 2026-05-18 ship: retail chase camera is the default. The // legacy camera remains opt-in via the DebugPanel toggle until // the follow-up deletion commit. Assert.True(CameraDiagnostics.UseRetailChaseCamera); } [Fact] public void Setters_PersistRuntimeChanges() { CameraDiagnostics.TranslationStiffness = 0.8f; CameraDiagnostics.UseRetailChaseCamera = false; Assert.Equal(0.8f, CameraDiagnostics.TranslationStiffness); Assert.False(CameraDiagnostics.UseRetailChaseCamera); // Reset so other tests aren't poisoned. CameraDiagnostics.TranslationStiffness = 0.45f; CameraDiagnostics.UseRetailChaseCamera = true; } }