aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-07-05 22:03:30 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:24 +0200
commit0da955d5fcd7db8bf85a55733257622682bf620e (patch)
tree04e5770b760a5a2b80e7fbdeb4c02636c616de2b
parentf46c023f0eadd2be844d40afaafded1b0f14a9fc (diff)
downloadmuhqs-game-0da955d5fcd7db8bf85a55733257622682bf620e.tar.gz
muhqs-game-0da955d5fcd7db8bf85a55733257622682bf620e.zip
add more card unit tests
-rw-r--r--go/game/card_test.go31
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")
+ }
+}