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:
20
progression.tests/SkillIdTests.cs
Normal file
20
progression.tests/SkillIdTests.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace Mr.BrickAdventures.Progression.Tests;
|
||||
|
||||
public class SkillIdTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("")]
|
||||
[InlineData(" ")]
|
||||
public void A_blank_id_is_not_a_skill(string value)
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => SkillId.Of(value));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Ids_with_the_same_text_are_the_same_skill()
|
||||
{
|
||||
// Owned skills are held in a dictionary keyed by id, so value equality is what makes the
|
||||
// type usable at all rather than a convenience.
|
||||
Assert.Equal(SkillId.Of("brick_throw"), SkillId.Of("brick_throw"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user