Close phase 36 apparel-changed log tail.

Add simulation and paged day-log tests; mark the log task complete in the phase doc.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 05:44:09 +03:00
co-authored by Cursor
parent 3fa6ce95df
commit 3485ce8ac4
3 changed files with 53 additions and 2 deletions
@@ -101,6 +101,38 @@ public class AppropriatenessSimulationTests
Assert.Contains(pupil.Items, item => item.Def == "TShirt" && item.Color == "Red" && item.Location == ItemLocations.Bag);
}
[Fact]
public void RedressPerson_WritesApparelChangedRows()
{
using var school = Open(TuesdayMorning, seed: 31);
school.DressRules = school.DressRules with
{
Students = new DressRulePair(FormPolicies.Regular, ColorPolicies.NoBright),
};
var pupil = school.Roster!.People.First(person => person.IsStudent && person.LockerRoomId is null);
var items = pupil.Items.ToList();
items.Add(new InventoryItem("TShirt", "Red", 1f, ItemLocations.Worn));
ReplaceItems(pupil, items);
ApparelDresser.RedressPerson(school, pupil, ApparelMode.Everyday, includeHome: false);
Assert.Contains(
school.DayLog,
row => row.PersonId == pupil.Id
&& row.Type == PersonLogTypes.ApparelChanged
&& row.ThingDef == "TShirt");
var page = PersonLogBrowser.Apply(
school.DayLog,
pupil.Id,
new PersonLogQuery(null, Descending: true, Page: 1, PageSize: 20),
school.Catalog,
"ru");
Assert.Contains(page.Entries, entry => entry.Type == PersonLogTypes.ApparelChanged);
Assert.Contains(
page.Entries,
entry => entry.Label.StartsWith("переоделся:", StringComparison.Ordinal));
}
[Fact]
public void PendingStrictRule_DoesNotApplyUntilNextMorning()
{