Files
przygody-pana-cegly/progression.tests/LevelTimeTests.cs
Gabriel Kaszewski 313a5315b1 feat(progression): Coins, LevelTime, SkillLevel core invariants (slice 1)
three bug-encoding invariants, one red/green cycle each:
- Coins.TrySubtract fails instead of clamping
- LevelTime rejects zero (continued-run zero best-times)
- SkillLevel has no zero (unowned is absence, not Level=1)

plan: drop signed NetCoins; add Attempt outcome as idempotency guard
2026-07-28 18:22:46 +02:00

14 lines
509 B
C#

namespace Mr.BrickAdventures.Progression.Tests;
public class LevelTimeTests
{
[Fact]
public void Zero_is_not_a_completion_time()
{
// GetCurrentLevelTime() returns 0 whenever the speedrun timer was never started, which
// today is every continued run — so zero-second "best times" get written to the ghost
// files. Rejecting zero makes that unrepresentable rather than merely unlikely.
Assert.Throws<ArgumentOutOfRangeException>(() => LevelTime.Of(0));
}
}