feat(progression): remaining slice 1 value objects
Lives (floors at zero, exhaustion observable), LevelId, SkillId, PlaythroughId (never self-generates, keeps tests deterministic), StatName enum, LevelTime rejects NaN/infinity. 14 tests. Arithmetic/comparison members deferred to the slices whose behaviour needs them rather than added speculatively.
This commit is contained in:
@@ -10,4 +10,14 @@ public class LevelTimeTests
|
||||
// files. Rejecting zero makes that unrepresentable rather than merely unlikely.
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => LevelTime.Of(0));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(double.NaN)]
|
||||
[InlineData(double.PositiveInfinity)]
|
||||
public void A_time_that_is_not_a_finite_number_is_rejected(double seconds)
|
||||
{
|
||||
// Times are derived from subtracting tick counts, so a stale or unset start time can
|
||||
// produce NaN or infinity rather than a plausible-but-wrong number.
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => LevelTime.Of(seconds));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user