using ClaudeDo.Worker.Report;

namespace ClaudeDo.Worker.Tests.Report;

public class WeekReportPromptBuilderTests
{
    [Fact]
    public void Build_IsDayMajor_AndIncludesNotesAndInstructions()
    {
        var repoA = new RepoActivity { RepoPath = @"C:\Dev\App" };
        var d1 = new DayActivity { Date = new DateOnly(2026, 6, 1) };
        d1.Prompts.Add("Add login");
        d1.Summaries.Add("Implemented login");
        repoA.Days.Add(d1);
        var d2 = new DayActivity { Date = new DateOnly(2026, 6, 2) };
        d2.Prompts.Add("Fix bug");
        repoA.Days.Add(d2);

        var notes = new Dictionary<DateOnly, List<string>>
        {
            [new DateOnly(2026, 6, 1)] = new() { "Standup um 9" },
        };

        var prompt = WeekReportPromptBuilder.Build(
            new DateOnly(2026, 5, 28), new DateOnly(2026, 6, 3),
            new[] { repoA }, notes);

        Assert.Contains("Write the ENTIRE report in German", prompt);
        var idxJun1 = prompt.IndexOf("2026-06-01", StringComparison.Ordinal);
        var idxJun2 = prompt.IndexOf("2026-06-02", StringComparison.Ordinal);
        Assert.True(idxJun1 >= 0 && idxJun2 > idxJun1);
        Assert.Contains("Add login", prompt);
        Assert.Contains("Implemented login", prompt);
        Assert.Contains("Standup um 9", prompt);
        Assert.Contains(@"C:\Dev\App", prompt);
    }
}
