diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-05 22:03:30 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-07-06 11:49:26 -0400 |
| commit | 8cc7981fc197f863cb342fa8cbaa9828b2233ac6 (patch) | |
| tree | 042d82b8d39ec4b6b691d3c2ec5fe432ba0a7e09 | |
| parent | 7beff7468b7bbf5a93eb22daa786eb215f1d54ee (diff) | |
| download | muhqs-game-8cc7981fc197f863cb342fa8cbaa9828b2233ac6.tar.gz muhqs-game-8cc7981fc197f863cb342fa8cbaa9828b2233ac6.zip | |
add more card unit tests
| -rw-r--r-- | go/game/card_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/go/game/card_test.go b/go/game/card_test.go index 8c2e7b16..3e9c8f6f 100644 --- a/go/game/card_test.go +++ b/go/game/card_test.go @@ -20,3 +20,34 @@ func TestLoadingUnknownCard(t *testing.T) { t.Fatal("expected urlErr:", err) } } + +func TestCardReporters(t *testing.T) { + archer := NewCard("base/archer") + recruit := NewCard("base/recruit") + ritual := NewCard("magic/ritual!") + sword := NewCard("base/sword") + + if !archer.IsBuyable() || !ritual.IsBuyable() || recruit.IsBuyable() || !sword.IsBuyable() { + t.Fatal("unexpected buyability result") + } + + if !archer.IsPermanent() || ritual.IsPermanent() || !recruit.IsPermanent() || !sword.IsPermanent() { + t.Fatal("unexpected permanent result") + } + + if archer.Type.IsArtifact() || !sword.Type.IsArtifact() { + t.Fatal("unexpected IsArtifact result") + } + + if archer.IsToken() || !recruit.IsToken() { + t.Fatal("unexpected IsToken result") + } + + if archer.hasEffect("crew") { + t.Fatal("archer has no crew effect") + } + + if archer.hasPlacementConstrain("swimmming") { + t.Fatal("archer is not swimming") + } +} |
