using HSchool.Content; namespace HSchool.Schedule.Tests; public class TimetableClockTests { private readonly DefCatalog _catalog = Fixtures.Catalog(); private static readonly LessonPlacement MathOnTuesdayPeriod3 = new( "c5A", "Mathematics", "t1", "classroom-101", Day: 1, Period: 3); [Fact] public void TuesdayTenTwenty_IsThePlacedLesson() { var table = new Timetable([MathOnTuesdayPeriod3], []); var occurring = TimetableClock.OccurringAt( table, _catalog, new DateTime(2012, 4, 3, 10, 20, 0, DateTimeKind.Utc), weekDays: 5); Assert.Equal([MathOnTuesdayPeriod3], occurring); } [Fact] public void TuesdayTenFifteen_IsABreakAndEmpty() { var table = new Timetable([MathOnTuesdayPeriod3], []); var occurring = TimetableClock.OccurringAt( table, _catalog, new DateTime(2012, 4, 3, 10, 15, 0, DateTimeKind.Utc), weekDays: 5); Assert.Empty(occurring); Assert.Equal( new OccupancyKey(new DateOnly(2012, 4, 3), DaySlotKind.Break, 2), TimetableClock.Key(_catalog, new DateTime(2012, 4, 3, 10, 15, 0, DateTimeKind.Utc), 5)); } [Fact] public void Saturday_IsEmpty() { var table = new Timetable([MathOnTuesdayPeriod3], []); var occurring = TimetableClock.OccurringAt( table, _catalog, new DateTime(2012, 4, 7, 10, 20, 0, DateTimeKind.Utc), weekDays: 5); Assert.Empty(occurring); } }