using FluentAssertions;
using SatelliteProvider.Common.Configs;

namespace SatelliteProvider.Tests;

// AZ-371 / C18 — verifies the config defaults preserve the original literal values
// that lived in source code prior to the magic-numbers-to-config refactor.
public class ConfigDefaultsTests
{
    [Fact]
    public void ProcessingConfig_RegionProcessingTimeout_PreservesOriginal_AZ371_AC2()
    {
        // Assert
        new ProcessingConfig().RegionProcessingTimeoutSeconds.Should().Be(300, "RegionService used TimeSpan.FromMinutes(5) before AZ-371");
    }

    [Fact]
    public void ProcessingConfig_RouteProcessingPollInterval_PreservesOriginal_AZ371_AC2()
    {
        // Assert
        new ProcessingConfig().RouteProcessingPollIntervalSeconds.Should().Be(5, "RouteProcessingService polled every 5s before AZ-371");
    }

    [Fact]
    public void ProcessingConfig_MaxRoutePointSpacingMeters_PreservesOriginal_AZ371_AC2()
    {
        // Assert
        new ProcessingConfig().MaxRoutePointSpacingMeters.Should().Be(200.0, "RoutePointGraphBuilder used 200m spacing before AZ-371");
    }

    [Fact]
    public void ProcessingConfig_LatLonTolerance_PreservesOriginal_AZ371_AC2()
    {
        // Assert
        new ProcessingConfig().LatLonTolerance.Should().Be(0.0001, "RouteValidator and GoogleMapsDownloaderV2 used 0.0001 before AZ-371");
    }

    [Fact]
    public void MapConfig_TileSizePixels_PreservesOriginal_AZ371_AC2()
    {
        // Assert
        new MapConfig().TileSizePixels.Should().Be(256, "TileService and GoogleMapsDownloaderV2 used 256 px before AZ-371");
    }

    [Fact]
    public void MapConfig_AllowedZoomLevels_PreservesOriginal_AZ371_AC2()
    {
        // Assert
        new MapConfig().AllowedZoomLevels.Should().Equal(15, 16, 17, 18, 19);
    }

    [Fact]
    public void MapConfig_RetryDelays_PreserveOriginal_AZ371_AC2()
    {
        // Arrange
        var cfg = new MapConfig();

        // Assert
        cfg.RetryBaseDelaySeconds.Should().Be(1);
        cfg.RetryMaxDelaySeconds.Should().Be(30);
    }
}
