Review slice 9 C-D: persist clash opinions and the bully's victim.
FinishConflict never set RosterTalkDirty, so people.json skipped quarrel shifts until some other save — the same seam as the A-B talk-circle fix. First BullyVictimId write stayed in RAM only. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -66,6 +66,22 @@ public class OpinionGeneratorTests
|
||||
Assert.Equal(before, loadedChild.Opinions[parentId]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RosterJson_RoundTripsBullyVictimId()
|
||||
{
|
||||
var roster = Fixtures.Generate(Fixtures.Classrooms(4));
|
||||
var bully = roster.People.First(person => person.IsStudent && !person.IsParent);
|
||||
var victim = roster.People.First(person =>
|
||||
person.IsStudent && !person.Id.Equals(bully.Id, StringComparison.Ordinal));
|
||||
bully.BullyVictimId = victim.Id;
|
||||
|
||||
var json = RosterJson.Serialize(RosterDocument.From(1, roster));
|
||||
Assert.Contains("\"bullyVictimId\"", json, StringComparison.Ordinal);
|
||||
var loaded = RosterJson.Parse(json).ToRoster();
|
||||
var loadedBully = loaded.People.First(person => person.Id.Equals(bully.Id, StringComparison.Ordinal));
|
||||
Assert.Equal(victim.Id, loadedBully.BullyVictimId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveWithoutOpinionsField_SeedsFamilyOnLoad()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user