using ClaudeDo.Data.Models;
using ClaudeDo.Worker.Prime;

namespace ClaudeDo.Worker.Tests.Prime;

public class PrimeScheduleValidationTests
{
    private static PrimeScheduleDto Dto(PrimeActionKind kind, string? prompt) =>
        new(Guid.NewGuid(), 31, new TimeSpan(7, 0, 0), true, null, prompt, kind);

    [Theory]
    [InlineData(null)]
    [InlineData("")]
    [InlineData("   ")]
    public void Custom_without_a_prompt_is_rejected(string? prompt)
    {
        var error = PrimeScheduleValidation.Validate(Dto(PrimeActionKind.Custom, prompt));
        Assert.NotNull(error);
    }

    [Fact]
    public void Custom_with_a_prompt_is_accepted()
    {
        Assert.Null(PrimeScheduleValidation.Validate(Dto(PrimeActionKind.Custom, "do the thing")));
    }

    [Fact]
    public void Ping_without_a_prompt_is_accepted()
    {
        Assert.Null(PrimeScheduleValidation.Validate(Dto(PrimeActionKind.Ping, null)));
    }

    [Fact]
    public void FillMyDay_without_a_prompt_is_accepted()
    {
        Assert.Null(PrimeScheduleValidation.Validate(Dto(PrimeActionKind.FillMyDay, null)));
    }
}
