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:
21
progression.tests/LivesTests.cs
Normal file
21
progression.tests/LivesTests.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace Mr.BrickAdventures.Progression.Tests;
|
||||
|
||||
public class LivesTests
|
||||
{
|
||||
[Fact]
|
||||
public void Losing_the_last_life_exhausts_them()
|
||||
{
|
||||
var remaining = Lives.Of(1).Decrement();
|
||||
|
||||
Assert.Equal(0, remaining.Value);
|
||||
Assert.True(remaining.IsExhausted);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Decrementing_when_already_exhausted_stays_at_zero()
|
||||
{
|
||||
var remaining = Lives.Of(0).Decrement();
|
||||
|
||||
Assert.Equal(0, remaining.Value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user