using ClaudeDo.Data.Filtering;
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;

namespace ClaudeDo.Data.Tests.Filtering;

public sealed class UserListFilterTests
{
    [Fact]
    public void Id_uses_user_prefix()
    {
        var f = new UserListFilter("inbox");
        Assert.Equal("user:inbox", f.Id);
    }

    [Fact]
    public void Matches_only_tasks_in_the_owning_list()
    {
        var f = new UserListFilter("inbox");
        Assert.True (f.Matches(TaskFactory.Make("a", listId: "inbox")));
        Assert.False(f.Matches(TaskFactory.Make("b", listId: "other")));
    }

    [Fact]
    public void Count_excludes_done_tasks()
    {
        var f = new UserListFilter("inbox");
        Assert.True (f.ShouldCount(TaskFactory.Make("a", listId: "inbox", status: TaskStatus.Idle)));
        Assert.False(f.ShouldCount(TaskFactory.Make("b", listId: "inbox", status: TaskStatus.Done)));
        Assert.False(f.ShouldCount(TaskFactory.Make("c", listId: "other", status: TaskStatus.Idle)));
    }
}
