using System;
using System.IO;

namespace CounterDrone.Core
{
    /// <summary>IPathProvider 的实现，用于单元测试环境</summary>
    public class TestPathProvider : IPathProvider
    {
        private readonly string _root;

        public TestPathProvider(string rootDir)
        {
            _root = rootDir;
            Directory.CreateDirectory(_root);
        }

        public string GetDataRoot() => _root;

        public string GetMainDbPath() => Path.Combine(_root, "main.db");

        public string GetFramesDir()
        {
            var dir = Path.Combine(_root, "frames");
            Directory.CreateDirectory(dir);
            return dir;
        }

        public string GetModelsDir()
        {
            var dir = Path.Combine(_root, "models");
            Directory.CreateDirectory(dir);
            return dir;
        }
    }
}
