summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop.Tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/LivingVillage.Desktop.Tests')
-rw-r--r--src/LivingVillage.Desktop.Tests/PrototypeTests.fs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
index 4d2c895..b250824 100644
--- a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
+++ b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
@@ -902,6 +902,20 @@ type PrototypeTests () =
Assert.AreEqual<int64>(6L * ticksPerHour, M6Presentation.startTickForHour 6.0)
[<TestMethod>]
+ member _.StartTickResolutionHonoursEvidenceHourThenDaylightThenMidnight () =
+ let ticksPerHour = Sim.ticksPerDay / 24L
+
+ // P17-FIX: the evidence hour must win on the sample/autoplay path too, otherwise
+ // StartNewGame re-created the world at 00:00 and dusk/day shots were actually night.
+ Assert.AreEqual<int64>(M6Presentation.startTickForHour 20.75, M6Presentation.resolveStartTick (Some 20.75) false)
+ Assert.AreEqual<int64>(int64 20 * ticksPerHour + ticksPerHour * 3L / 4L, M6Presentation.resolveStartTick (Some 20.75) false)
+ // Explicit hour overrides the daylight bootstrap.
+ Assert.AreEqual<int64>(12L * ticksPerHour, M6Presentation.resolveStartTick (Some 12.0) true)
+ // No override: daylight -> 6:00, otherwise midnight.
+ Assert.AreEqual<int64>(6L * ticksPerHour, M6Presentation.resolveStartTick None true)
+ Assert.AreEqual<int64>(0L, M6Presentation.resolveStartTick None false)
+
+ [<TestMethod>]
member _.TitleEntranceProgressIsDeterministicAndCompleteAfterTwoSeconds () =
// 120 frames at the fixed 60Hz step = 2s entrance, pure function of frame count.
Assert.AreEqual<float32>(1.0f, TitleScreen.entranceProgress 0L)