using Jiaowu.Api.Domain.Academic;
using Jiaowu.Api.Infrastructure.Graduation;

namespace Jiaowu.Api.Tests;

public sealed class CurriculumPlanEditingPolicyTests
{
    [Theory]
    [InlineData(CurriculumPlanStatus.Draft, true)]
    [InlineData(CurriculumPlanStatus.Published, true)]
    [InlineData(CurriculumPlanStatus.Archived, false)]
    public void Content_modification_is_limited_to_draft_and_published_plans(
        CurriculumPlanStatus status,
        bool expected)
    {
        Assert.Equal(expected, CurriculumPlanEditingPolicy.CanModifyContent(status));
    }

    [Theory]
    [InlineData(CurriculumPlanStatus.Draft, true)]
    [InlineData(CurriculumPlanStatus.Published, false)]
    [InlineData(CurriculumPlanStatus.Archived, false)]
    public void Only_draft_plans_can_change_their_applicability(
        CurriculumPlanStatus status,
        bool expected)
    {
        Assert.Equal(expected, CurriculumPlanEditingPolicy.CanChangeApplicability(status));
    }
}
