Unterrichtsplanung: Serienerzeugung, Stundenraster, Aufsichten & Vertretung (Kapitel 4.2/4.3 Nachtrag)

Stunden serienweise aus dem Stundenplan erzeugen (4.2.5); Stundenraster
(Uhrzeiten je Stunde) in den Einstellungen mit Zeitbedarf-Rückmeldung im
Verlaufsplan-Editor; wiederkehrende Pausenaufsicht; neuer "Vertretung
eintragen"-Dialog für einmalige Vertretungsaufsicht, Vertretungsstunde,
Sondereinsätze (Ausflüge, Berufsmessen) und schlichten Stundenausfall.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-15 21:59:07 +02:00
co-authored by Claude Sonnet 5
parent 99b2de6519
commit d6dee72acc
30 changed files with 2743 additions and 48 deletions
+57
View File
@@ -588,4 +588,61 @@ public sealed class RepositoryTests
Assert.Equal("Osterferien", result[0].Name);
Assert.Equal("Sommerferien", result[1].Name);
}
// ── SupervisionDutyRepository ─────────────────────────────────────────────
[Fact]
public void SupervisionDutyRepository_Save_LehntDoppelbelegungDerselbenPauseAb()
{
using var db = NewInMemoryContext();
var repo = new SupervisionDutyRepository(db);
repo.Save(new SupervisionDuty { Weekday = DayOfWeek.Monday, AfterPeriod = 2, Location = "Pausenhof" });
Assert.Throws<InvalidOperationException>(() =>
repo.Save(new SupervisionDuty { Weekday = DayOfWeek.Monday, AfterPeriod = 2, Location = "Bibliothek" }));
}
[Fact]
public void SupervisionDutyRepository_Save_AktualisierenDerselbenAufsichtIstErlaubt()
{
using var db = NewInMemoryContext();
var repo = new SupervisionDutyRepository(db);
var duty = new SupervisionDuty { Weekday = DayOfWeek.Monday, AfterPeriod = 2, Location = "Pausenhof" };
repo.Save(duty);
duty.Location = "Bibliothek";
repo.Save(duty);
Assert.Equal("Bibliothek", repo.GetAll().Single().Location);
}
[Fact]
public void SupervisionDutyRepository_GetAll_SortiertNachWochentagUndPause()
{
using var db = NewInMemoryContext();
var repo = new SupervisionDutyRepository(db);
repo.Save(new SupervisionDuty { Weekday = DayOfWeek.Tuesday, AfterPeriod = 1, Location = "A" });
repo.Save(new SupervisionDuty { Weekday = DayOfWeek.Monday, AfterPeriod = 4, Location = "B" });
repo.Save(new SupervisionDuty { Weekday = DayOfWeek.Monday, AfterPeriod = 2, Location = "C" });
var result = repo.GetAll();
Assert.Equal(["C", "B", "A"], result.Select(d => d.Location));
}
// ── SubstitutionEntryRepository ───────────────────────────────────────────
[Fact]
public void SubstitutionEntryRepository_GetByDate_FindetNurEintraegeDesTages()
{
using var db = NewInMemoryContext();
var repo = new SubstitutionEntryRepository(db);
repo.Save(new SubstitutionEntry { Date = new DateOnly(2026, 3, 12), Kind = SubstitutionKind.Lesson, PeriodNumber = 3, Description = "Vertretung 8a" });
repo.Save(new SubstitutionEntry { Date = new DateOnly(2026, 3, 13), Kind = SubstitutionKind.Supervision, AfterPeriod = 2, Description = "Vertretung Hr. Müller" });
var result = repo.GetByDate(new DateOnly(2026, 3, 12));
Assert.Single(result);
Assert.Equal("Vertretung 8a", result[0].Description);
}
}