using System.Collections.Generic;
using Xunit;
using QuantEngine.Core.Domain;

namespace QuantEngine.Core.Tests;

public class WalkForwardEngineTests
{
    [Fact]
    public void RunWalkForward_WithValidData_ReturnsMinimumFourWindowsAndPassesGate()
    {
        // Arrange
        var engine = new WalkForwardEngine();
        var dailyValues = new List<decimal>();
        for (int i = 0; i < 252 * 3; i++)
        {
            dailyValues.Add(100m + (i * 0.1m));
        }

        // Act
        var result = engine.RunWalkForward("formula_ss001_v1", dailyValues, 4);

        // Assert
        Assert.Equal("formula_ss001_v1", result.FormulaId);
        Assert.Equal("PASS", result.GateStatus);
        Assert.True(result.TotalWindows >= 4);
        Assert.True(result.AverageOosSharpe > 0);
    }
}
