Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

Tests: a locked project's refusal changes nothing; debt dollars do nothing under legacy (Refs #2733 items 16 and 17) (#2774)

Berid788e8c7c5b0
diff --git a/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.cs b/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.cs
index a8b6e8bd3..79c55deb8 100644
--- a/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.cs
+++ b/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.cs
@@ -436,6 +436,23 @@ public class Gdd03EventRulesTests
Assert.EndsWith("(Fixture)", line.Message);
Assert.Equal((CauseKeys.EventAmount, 26.0), (Assert.Single(shown).Key, shown[0].Delta));
}
+ // R-EFX-009 under legacy (#2733 item 17): the plain fixture has no GDD loop at all, and debt_dollars still adds no
+ // Debt, takes no Treasury, and neither the choice nor its preview has a debt line.
+ [Fact]
+ public void DebtDollarsDoNothingUnderLegacy()
+ {
+ var c = ContentLoader.Load(Fixture.Write(null, new() { ["probe.yaml"] = Card(option: " debt_dollars: 52\n") }));
+ Assert.False(c.IsGdd);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ s.PendingEvents.Add("probe");
+ var (debt, treasury) = (s.Debt, s.Treasury);
+ var preview = EventSystem.OptionEffects(c, s, c.Events.Single(e => e.Id == "probe").Options[0]);
+ var why = new List<Cause>();
+ Assert.Null(EventSystem.Choose(c, s, "probe", "ok", why));
+ Assert.Equal((debt, treasury), (s.Debt, s.Treasury));
+ Assert.DoesNotContain(why, x => x.Target == "debt");
+ Assert.DoesNotContain(preview, x => x.Target == "debt");
+ }
// R-EFX-009, R-EVT-003: a disloyal minister's half share halves the Debt with the foreign currency.
[Fact]
public void DelegatedHalfShareHalvesTheDebt()
diff --git a/sim/Statecraft.Sim.Tests/StructuredEffectTests.cs b/sim/Statecraft.Sim.Tests/StructuredEffectTests.cs
index 0cef4b3fd..363dfedde 100644
--- a/sim/Statecraft.Sim.Tests/StructuredEffectTests.cs
+++ b/sim/Statecraft.Sim.Tests/StructuredEffectTests.cs
@@ -333,6 +333,23 @@ sources: [{ url: https://example.org/event, checked: 2026-10-18 }]
Assert.Null(Projects.CheckCity(c, s, "industry", "town_a", 1, 1));
}
+ // R-EFX-008 (#2733 item 16): the refusal of a locked kind changes nothing. Attention is refunded (start_project's base cost is
+ // 1 in the fixture), the state is the no-order preview's, and no project or Why line is added.
+ [Fact]
+ public void ALockedProjectsRefusalChangesNothing()
+ {
+ var c = Load(Event(UnlockIndustry), projects: LockedIndustry);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ Assert.Equal(1.0, c.Rules.AttentionCost[Projects.StartProjectKind]);
+ var none = Simulation.Preview(c, s, Array.Empty<Command>());
+ var r = Simulation.Preview(c, s, new Command[] { new StartProject("industry", "town_a", 1, 1) });
+ Assert.Equal("An industry project is not available yet", Assert.Single(r.Rejected).Reason);
+ Assert.Equal(s.Attention, r.State.Attention);
+ Assert.Equal(none.State.Hash(), r.State.Hash());
+ Assert.Empty(r.State.CityProjects);
+ Assert.Equal(none.Why.Select(w => (w.Key, w.Target, w.Message)), r.Why.Select(w => (w.Key, w.Target, w.Message)));
+ }
+
// R-EFX-008: the unlock is game state, so a save replays it to the same hash.
[Fact]
public void ASaveWithAnUnlockReplays()