using System;
using System.IO;
using CounterDrone.Core.Algorithms;

namespace CounterDrone.Core.Tests
{
    /// <summary>测试用 PlannerConfig 加载辅助。
    /// 从仓库 data/planner_config.json 加载真实配置，确保测试与生产配置一致。</summary>
    public static class TestPlannerConfig
    {
        private static readonly Lazy<PlannerConfig> _instance = new(() =>
        {
            // bin\Debug\net10.0 → 上 6 层到仓库根，再进 data 目录
            string baseDir = AppDomain.CurrentDomain.BaseDirectory;
            string repoRoot = Path.GetFullPath(Path.Combine(baseDir, "..", "..", "..", "..", "..", ".."));
            return PlannerConfig.Load(Path.Combine(repoRoot, "data"));
        });

        public static PlannerConfig Instance => _instance.Value;
    }
}
