From 8cc7981fc197f863cb342fa8cbaa9828b2233ac6 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 5 Jul 2025 22:03:30 -0400 Subject: add more card unit tests --- go/game/card_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) 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") + } +} -- cgit v1.2.3