Add tests that lesson-consequence promises were missing.

Teacher action must not cancel gain, a missing warmth need matches full warmth, snow on the street must reach DayPlans, and a lazy pupil still appears closer to the bell.
This commit is contained in:
Leonid Pershin
2026-08-20 17:11:06 +03:00
parent cd68d2e6b8
commit aa20534b77
4 changed files with 135 additions and 1 deletions
+24
View File
@@ -162,6 +162,30 @@ public class WalkingTests
Assert.True(implied.Comes);
}
[Fact]
public void Lazy_AppearsCloserToTheBell_OnSnow()
{
var (catalog, map) = Fixtures.Vanilla();
var walks = WalkGraph.Build(catalog, map);
var roster = RosterGenerator.Generate(catalog, map, schoolSeed: 9, "Russia", TuesdayLesson);
var lazy = roster.People.First(person => person.IsStudent && person.Traits.Contains("Lazy"));
var schoolClass = roster.Classes.First(row => row.Id == lazy.ClassId);
var keen = roster.People.First(person =>
person.IsStudent && person.ClassId == lazy.ClassId && !person.Traits.Contains("Lazy"));
var table = new Timetable(
[new LessonPlacement(schoolClass.Id, "Mathematics", "t1", schoolClass.RoomId, Day: 1, Period: 1)],
[]);
var extra = catalog.BehaviorRules!.CommuteSnowMinutes;
var lazyPlan = DayPlans.Build(
catalog, walks, lazy, schoolClass, table, TuesdayLesson, weekDays: 5, schoolSeed: 9, extra);
var keenPlan = DayPlans.Build(
catalog, walks, keen, schoolClass, table, TuesdayLesson, weekDays: 5, schoolSeed: 9, extra);
Assert.True(lazyPlan.Comes);
Assert.True(keenPlan.Comes);
Assert.True(lazyPlan.AppearAt > keenPlan.AppearAt);
}
[Fact]
public void SameSeedAndSnowMinutes_YieldTheSameAppearAt()
{