using Jiaowu.Api.Infrastructure.Exams;

namespace Jiaowu.Api.Tests;

public sealed class ExamConflictRulesTests
{
    [Fact]
    public void Overlapping_exam_times_conflict() =>
        Assert.True(ExamConflictRules.TimeOverlaps(
            new DateTime(2027, 1, 8, 9, 0, 0),
            new DateTime(2027, 1, 8, 11, 0, 0),
            new DateTime(2027, 1, 8, 10, 30, 0),
            new DateTime(2027, 1, 8, 12, 0, 0)));

    [Fact]
    public void Adjacent_exam_times_do_not_conflict() =>
        Assert.False(ExamConflictRules.TimeOverlaps(
            new DateTime(2027, 1, 8, 9, 0, 0),
            new DateTime(2027, 1, 8, 11, 0, 0),
            new DateTime(2027, 1, 8, 11, 0, 0),
            new DateTime(2027, 1, 8, 13, 0, 0)));
}
