namespace TaxBaik.Application.Tests;

using TaxBaik.Application.Seasonal;
using TaxBaik.Application.Services;
using Xunit;

public class SeasonalMarketingServiceTests
{
    [Theory]
    [InlineData(2026, 1, 25, 2026, 1, 26)]
    [InlineData(2026, 2, 28, 2026, 3, 3)]
    [InlineData(2026, 3, 31, 2026, 3, 31)]
    [InlineData(2026, 5, 31, 2026, 6, 1)]
    [InlineData(2026, 7, 25, 2026, 7, 27)]
    [InlineData(2026, 11, 30, 2026, 11, 30)]
    [InlineData(2026, 12, 31, 2026, 12, 31)]
    public void SeasonalDeadlines_ApplyBusinessDayRollForward(
        int year, int month, int day,
        int expectedYear, int expectedMonth, int expectedDay)
    {
        var deadline = new DateOnly(year, month, day);
        var effective = BusinessDayCalculator.GetEffectiveBusinessDate(deadline);

        Assert.Equal(new DateOnly(expectedYear, expectedMonth, expectedDay), effective);
    }

    [Theory]
    [InlineData(2026, 7, 24, 2026, 7, 27, 3)]
    [InlineData(2026, 7, 25, 2026, 7, 27, 2)]
    [InlineData(2026, 7, 26, 2026, 7, 27, 1)]
    public void SeasonalDeadlines_UseBusinessDayDiff(
        int refYear, int refMonth, int refDay,
        int expectedYear, int expectedMonth, int expectedDay,
        int expectedDays)
    {
        var deadline = new DateOnly(2026, 7, 25);
        var reference = new DateOnly(refYear, refMonth, refDay);
        var days = BusinessDayCalculator.GetBusinessDayDiff(deadline, reference);

        Assert.Equal(expectedDays, days);
        Assert.Equal(new DateOnly(expectedYear, expectedMonth, expectedDay), BusinessDayCalculator.GetEffectiveBusinessDate(deadline));
    }
}
